Add new metrics for post menu interactions (#10022)

Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
DS Boyce
2026-03-11 11:30:33 -07:00
committed by GitHub
parent 0937f522af
commit 850e6e6f52
3 changed files with 81 additions and 1 deletions
+6
View File
@@ -417,6 +417,7 @@ function useProfileUnfollowMutation(
export function useProfileMuteMutationQueue(
profile: Shadow<bsky.profile.AnyProfileView>,
) {
const ax = useAnalytics()
const queryClient = useQueryClient()
const did = profile.did
const initialMuted = profile.viewer?.muted
@@ -430,11 +431,13 @@ export function useProfileMuteMutationQueue(
await muteMutation.mutateAsync({
did,
})
ax.metric('profile:mute', {})
return true
} else {
await unmuteMutation.mutateAsync({
did,
})
ax.metric('profile:unmute', {})
return false
}
},
@@ -492,6 +495,7 @@ function useProfileUnmuteMutation() {
export function useProfileBlockMutationQueue(
profile: Shadow<bsky.profile.AnyProfileView>,
) {
const ax = useAnalytics()
const queryClient = useQueryClient()
const did = profile.did
const initialBlockingUri = profile.viewer?.blocking
@@ -505,6 +509,7 @@ export function useProfileBlockMutationQueue(
const {uri} = await blockMutation.mutateAsync({
did,
})
ax.metric('profile:block', {})
return uri
} else {
if (prevBlockUri) {
@@ -512,6 +517,7 @@ export function useProfileBlockMutationQueue(
did,
blockUri: prevBlockUri,
})
ax.metric('profile:unblock', {})
}
return undefined
}