add recId to onboarding
This commit is contained in:
@@ -467,8 +467,8 @@ export type Events = {
|
|||||||
| 'InterstitialProfile'
|
| 'InterstitialProfile'
|
||||||
| 'Profile'
|
| 'Profile'
|
||||||
| 'Onboarding'
|
| 'Onboarding'
|
||||||
location: 'Card' | 'Profile'
|
location: 'Card' | 'Profile' | 'FollowAll'
|
||||||
recId?: number
|
recId?: number | string
|
||||||
position: number
|
position: number
|
||||||
suggestedDid: string
|
suggestedDid: string
|
||||||
category: string | null
|
category: string | null
|
||||||
@@ -479,7 +479,7 @@ export type Events = {
|
|||||||
| 'InterstitialDiscover'
|
| 'InterstitialDiscover'
|
||||||
| 'InterstitialProfile'
|
| 'InterstitialProfile'
|
||||||
| 'Onboarding'
|
| 'Onboarding'
|
||||||
recId?: number
|
recId?: number | string
|
||||||
position: number
|
position: number
|
||||||
suggestedDid: string
|
suggestedDid: string
|
||||||
category: string | null
|
category: string | null
|
||||||
@@ -492,7 +492,7 @@ export type Events = {
|
|||||||
| 'Profile'
|
| 'Profile'
|
||||||
| 'Onboarding'
|
| 'Onboarding'
|
||||||
| 'ProgressGuide'
|
| 'ProgressGuide'
|
||||||
recId?: number
|
recId?: number | string
|
||||||
position: number
|
position: number
|
||||||
suggestedDid: string
|
suggestedDid: string
|
||||||
category: string | null
|
category: string | null
|
||||||
@@ -507,7 +507,7 @@ export type Events = {
|
|||||||
}
|
}
|
||||||
'suggestedUser:dismiss': {
|
'suggestedUser:dismiss': {
|
||||||
logContext: 'InterstitialDiscover' | 'InterstitialProfile'
|
logContext: 'InterstitialDiscover' | 'InterstitialProfile'
|
||||||
recId?: number
|
recId?: number | string
|
||||||
position: number
|
position: number
|
||||||
suggestedDid: string
|
suggestedDid: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,6 +97,17 @@ export function StepSuggestedAccounts() {
|
|||||||
tab: selectedInterest ?? 'all',
|
tab: selectedInterest ?? 'all',
|
||||||
numAccounts: followableDids.length,
|
numAccounts: followableDids.length,
|
||||||
})
|
})
|
||||||
|
for (let i = 0; i < followableDids.length; i++) {
|
||||||
|
const did = followableDids[i]
|
||||||
|
ax.metric('suggestedUser:follow', {
|
||||||
|
logContext: 'Onboarding',
|
||||||
|
location: 'FollowAll',
|
||||||
|
recId: suggestedUsers?.recId,
|
||||||
|
position: i,
|
||||||
|
suggestedDid: did,
|
||||||
|
category: selectedInterest,
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mutationFn: async () => {
|
mutationFn: async () => {
|
||||||
for (const did of followableDids) {
|
for (const did of followableDids) {
|
||||||
@@ -135,14 +146,14 @@ export function StepSuggestedAccounts() {
|
|||||||
seenProfilesRef.current.add(did)
|
seenProfilesRef.current.add(did)
|
||||||
ax.metric('suggestedUser:seen', {
|
ax.metric('suggestedUser:seen', {
|
||||||
logContext: 'Onboarding',
|
logContext: 'Onboarding',
|
||||||
recId: undefined,
|
recId: suggestedUsers?.recId,
|
||||||
position,
|
position,
|
||||||
suggestedDid: did,
|
suggestedDid: did,
|
||||||
category: selectedInterest,
|
category: selectedInterest,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[ax, selectedInterest],
|
[ax, selectedInterest, suggestedUsers?.recId],
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -220,6 +231,7 @@ export function StepSuggestedAccounts() {
|
|||||||
position={index}
|
position={index}
|
||||||
category={selectedInterest}
|
category={selectedInterest}
|
||||||
onSeen={onProfileSeen}
|
onSeen={onProfileSeen}
|
||||||
|
recId={suggestedUsers.recId}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
@@ -234,7 +246,7 @@ export function StepSuggestedAccounts() {
|
|||||||
color="secondary"
|
color="secondary"
|
||||||
size="large"
|
size="large"
|
||||||
label={_(msg`Retry`)}
|
label={_(msg`Retry`)}
|
||||||
onPress={() => refetch()}>
|
onPress={() => void refetch()}>
|
||||||
<ButtonText>
|
<ButtonText>
|
||||||
<Trans>Retry</Trans>
|
<Trans>Retry</Trans>
|
||||||
</ButtonText>
|
</ButtonText>
|
||||||
@@ -329,12 +341,14 @@ function SuggestedProfileCard({
|
|||||||
position,
|
position,
|
||||||
category,
|
category,
|
||||||
onSeen,
|
onSeen,
|
||||||
|
recId,
|
||||||
}: {
|
}: {
|
||||||
profile: bsky.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
position: number
|
position: number
|
||||||
category: string | null
|
category: string | null
|
||||||
onSeen: (did: string, position: number) => void
|
onSeen: (did: string, position: number) => void
|
||||||
|
recId?: number | string
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
@@ -401,7 +415,7 @@ function SuggestedProfileCard({
|
|||||||
ax.metric('suggestedUser:follow', {
|
ax.metric('suggestedUser:follow', {
|
||||||
logContext: 'Onboarding',
|
logContext: 'Onboarding',
|
||||||
location: 'Card',
|
location: 'Card',
|
||||||
recId: undefined,
|
recId,
|
||||||
position,
|
position,
|
||||||
suggestedDid: profile.did,
|
suggestedDid: profile.did,
|
||||||
category,
|
category,
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ export function useSuggestedUsers({
|
|||||||
data: searched?.data
|
data: searched?.data
|
||||||
? {
|
? {
|
||||||
actors: searched.data.pages.flatMap(p => p.actors) ?? [],
|
actors: searched.data.pages.flatMap(p => p.actors) ?? [],
|
||||||
|
recId: undefined,
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
isLoading: searched.isLoading,
|
isLoading: searched.isLoading,
|
||||||
|
|||||||
Reference in New Issue
Block a user