add some metrics for labelers (#7747)
* add some metrics * add label pref switch metric * Update src/screens/Profile/Header/ProfileHeaderLabeler.tsx * Use new logger.metric * Fix conflicting types * Remove duplicate toasts * Move metric to try body * Move metric to try body --------- Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
@@ -8,6 +8,7 @@ import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query'
|
||||
import {PROD_DEFAULT_FEED} from '#/lib/constants'
|
||||
import {replaceEqualDeep} from '#/lib/functions'
|
||||
import {getAge} from '#/lib/strings/time'
|
||||
import {logger} from '#/logger'
|
||||
import {STALE} from '#/state/queries'
|
||||
import {
|
||||
DEFAULT_HOME_FEED_PREFS,
|
||||
@@ -96,6 +97,11 @@ export function usePreferencesSetContentLabelMutation() {
|
||||
>({
|
||||
mutationFn: async ({label, visibility, labelerDid}) => {
|
||||
await agent.setContentLabelPref(label, visibility, labelerDid)
|
||||
logger.metric(
|
||||
'moderation:changeLabelPreference',
|
||||
{preference: visibility},
|
||||
{statsig: true},
|
||||
)
|
||||
// triggers a refetch
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: preferencesQueryKey,
|
||||
|
||||
Reference in New Issue
Block a user