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:
Hailey
2025-03-06 12:20:48 -08:00
committed by GitHub
parent 153fc17676
commit 618c4e4a56
4 changed files with 50 additions and 1 deletions
@@ -134,11 +134,21 @@ let ProfileHeaderLabeler = ({
const onPressSubscribe = React.useCallback(
() =>
requireAuth(async (): Promise<void> => {
const subscribe = !isSubscribed
try {
await toggleSubscription({
did: profile.did,
subscribe: !isSubscribed,
subscribe,
})
logger.metric(
subscribe
? 'moderation:subscribedToLabeler'
: 'moderation:unsubscribedFromLabeler',
{},
{statsig: true},
)
} catch (e: any) {
reset()
if (e.message === 'MAX_LABELERS') {