about summary refs log tree commit diff
path: root/src/state/queries
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2025-03-06 12:20:48 -0800
committerGitHub <noreply@github.com>2025-03-06 14:20:48 -0600
commit618c4e4a56987a1520ee9ca871b2d8e20b13fded (patch)
treed78d5ee52b15e65e99eb410df7e9a792936b3907 /src/state/queries
parent153fc17676cf9301e0f066e3c280da83821a6a63 (diff)
downloadvoidsky-618c4e4a56987a1520ee9ca871b2d8e20b13fded.tar.zst
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>
Diffstat (limited to 'src/state/queries')
-rw-r--r--src/state/queries/preferences/index.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/state/queries/preferences/index.ts b/src/state/queries/preferences/index.ts
index 3cb121a47..81b3dd086 100644
--- a/src/state/queries/preferences/index.ts
+++ b/src/state/queries/preferences/index.ts
@@ -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,