invert flag for sending to statsig (#8431)
This commit is contained in:
@@ -242,11 +242,15 @@ let PostMenuItems = ({
|
||||
AppBskyFeedPost.isRecord,
|
||||
)
|
||||
) {
|
||||
logger.metric('translate', {
|
||||
sourceLanguages: post.record.langs ?? [],
|
||||
targetLanguage: langPrefs.primaryLanguage,
|
||||
textLength: post.record.text.length,
|
||||
})
|
||||
logger.metric(
|
||||
'translate',
|
||||
{
|
||||
sourceLanguages: post.record.langs ?? [],
|
||||
targetLanguage: langPrefs.primaryLanguage,
|
||||
textLength: post.record.text.length,
|
||||
},
|
||||
{statsig: false},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,9 +161,13 @@ export function InitialVerificationAnnouncement() {
|
||||
color="primary"
|
||||
style={[a.justify_center, a.w_full]}
|
||||
onPress={() => {
|
||||
logger.metric('verification:learn-more', {
|
||||
location: 'initialAnnouncementeNux',
|
||||
})
|
||||
logger.metric(
|
||||
'verification:learn-more',
|
||||
{
|
||||
location: 'initialAnnouncementeNux',
|
||||
},
|
||||
{statsig: false},
|
||||
)
|
||||
}}>
|
||||
<ButtonText>
|
||||
<Trans>Read blog post</Trans>
|
||||
|
||||
@@ -63,11 +63,15 @@ export let MessageContextMenu = ({
|
||||
)
|
||||
openLink(translatorUrl, true)
|
||||
|
||||
logger.metric('translate', {
|
||||
sourceLanguages: [],
|
||||
targetLanguage: langPrefs.primaryLanguage,
|
||||
textLength: message.text.length,
|
||||
})
|
||||
logger.metric(
|
||||
'translate',
|
||||
{
|
||||
sourceLanguages: [],
|
||||
targetLanguage: langPrefs.primaryLanguage,
|
||||
textLength: message.text.length,
|
||||
},
|
||||
{statsig: false},
|
||||
)
|
||||
}, [langPrefs.primaryLanguage, message.text, openLink])
|
||||
|
||||
const onDelete = useCallback(() => {
|
||||
|
||||
@@ -158,7 +158,11 @@ export function LiveStatus({
|
||||
color="primary"
|
||||
variant="solid"
|
||||
onPress={() => {
|
||||
logger.metric('live:card:watch', {subject: profile.did})
|
||||
logger.metric(
|
||||
'live:card:watch',
|
||||
{subject: profile.did},
|
||||
{statsig: true},
|
||||
)
|
||||
openLink(embed.external.uri, false)
|
||||
}}>
|
||||
<ButtonText>
|
||||
@@ -187,7 +191,11 @@ export function LiveStatus({
|
||||
color="secondary"
|
||||
variant="solid"
|
||||
onPress={() => {
|
||||
logger.metric('live:card:openProfile', {subject: profile.did})
|
||||
logger.metric(
|
||||
'live:card:openProfile',
|
||||
{subject: profile.did},
|
||||
{statsig: true},
|
||||
)
|
||||
unstableCacheProfileView(queryClient, profile)
|
||||
onPressOpenProfile()
|
||||
}}>
|
||||
|
||||
@@ -140,9 +140,17 @@ export function useUpsertLiveStatusMutation(
|
||||
},
|
||||
onSuccess: ({record, image}) => {
|
||||
if (createdAt) {
|
||||
logger.metric('live:edit', {duration: record.durationMinutes})
|
||||
logger.metric(
|
||||
'live:edit',
|
||||
{duration: record.durationMinutes},
|
||||
{statsig: true},
|
||||
)
|
||||
} else {
|
||||
logger.metric('live:create', {duration: record.durationMinutes})
|
||||
logger.metric(
|
||||
'live:create',
|
||||
{duration: record.durationMinutes},
|
||||
{statsig: true},
|
||||
)
|
||||
}
|
||||
|
||||
Toast.show(_(msg`You are now live!`))
|
||||
@@ -199,7 +207,7 @@ export function useRemoveLiveStatusMutation() {
|
||||
})
|
||||
},
|
||||
onSuccess: () => {
|
||||
logger.metric('live:remove', {})
|
||||
logger.metric('live:remove', {}, {statsig: true})
|
||||
Toast.show(_(msg`You are no longer live`))
|
||||
control.close(() => {
|
||||
if (!currentAccount) return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import {Pressable, View} from 'react-native'
|
||||
import {ScrollView} from 'react-native-gesture-handler'
|
||||
import {AppBskyLabelerDefs} from '@atproto/api'
|
||||
import {type ScrollView} from 'react-native-gesture-handler'
|
||||
import {type AppBskyLabelerDefs} from '@atproto/api'
|
||||
import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
@@ -33,9 +33,9 @@ import {useSubmitReportMutation} from './action'
|
||||
import {DMCA_LINK} from './const'
|
||||
import {useCopyForSubject} from './copy'
|
||||
import {initialState, reducer} from './state'
|
||||
import {ReportDialogProps, ReportSubject} from './types'
|
||||
import {type ReportDialogProps, type ReportSubject} from './types'
|
||||
import {parseReportSubject} from './utils/parseReportSubject'
|
||||
import {ReportOption, useReportOptions} from './utils/useReportOptions'
|
||||
import {type ReportOption, useReportOptions} from './utils/useReportOptions'
|
||||
|
||||
export {useDialogControl as useReportDialogControl} from '#/components/Dialog'
|
||||
|
||||
@@ -51,7 +51,7 @@ export function ReportDialog(
|
||||
[props.subject],
|
||||
)
|
||||
const onClose = React.useCallback(() => {
|
||||
logger.metric('reportDialog:close', {})
|
||||
logger.metric('reportDialog:close', {}, {statsig: false})
|
||||
}, [])
|
||||
return (
|
||||
<Dialog.Outer control={props.control} onClose={onClose}>
|
||||
@@ -155,17 +155,21 @@ function Inner(props: ReportDialogProps) {
|
||||
}),
|
||||
)
|
||||
setSuccess(true)
|
||||
logger.metric('reportDialog:success', {
|
||||
reason: state.selectedOption?.reason!,
|
||||
labeler: state.selectedLabeler?.creator.handle!,
|
||||
details: !!state.details,
|
||||
})
|
||||
logger.metric(
|
||||
'reportDialog:success',
|
||||
{
|
||||
reason: state.selectedOption?.reason!,
|
||||
labeler: state.selectedLabeler?.creator.handle!,
|
||||
details: !!state.details,
|
||||
},
|
||||
{statsig: false},
|
||||
)
|
||||
// give time for user feedback
|
||||
setTimeout(() => {
|
||||
props.control.close()
|
||||
}, 1e3)
|
||||
} catch (e: any) {
|
||||
logger.metric('reportDialog:failure', {})
|
||||
logger.metric('reportDialog:failure', {}, {statsig: false})
|
||||
logger.error(e, {
|
||||
source: 'ReportDialog',
|
||||
})
|
||||
@@ -179,9 +183,13 @@ function Inner(props: ReportDialogProps) {
|
||||
}, [_, submitReport, state, dispatch, props, setPending, setSuccess])
|
||||
|
||||
React.useEffect(() => {
|
||||
logger.metric('reportDialog:open', {
|
||||
subjectType: props.subject.type,
|
||||
})
|
||||
logger.metric(
|
||||
'reportDialog:open',
|
||||
{
|
||||
subjectType: props.subject.type,
|
||||
},
|
||||
{statsig: false},
|
||||
)
|
||||
}, [props.subject])
|
||||
|
||||
return (
|
||||
|
||||
@@ -100,7 +100,7 @@ export function Badge({
|
||||
}
|
||||
hitSlop={20}
|
||||
onPress={() => {
|
||||
logger.metric('verification:badge:click', {})
|
||||
logger.metric('verification:badge:click', {}, {statsig: true})
|
||||
if (state.profile.role === 'verifier') {
|
||||
verifierDialogControl.open()
|
||||
} else {
|
||||
|
||||
@@ -153,9 +153,13 @@ function Inner({
|
||||
color="secondary"
|
||||
style={[a.justify_center]}
|
||||
onPress={() => {
|
||||
logger.metric('verification:learn-more', {
|
||||
location: 'verificationsDialog',
|
||||
})
|
||||
logger.metric(
|
||||
'verification:learn-more',
|
||||
{
|
||||
location: 'verificationsDialog',
|
||||
},
|
||||
{statsig: true},
|
||||
)
|
||||
}}>
|
||||
<ButtonText>
|
||||
<Trans>Learn more</Trans>
|
||||
|
||||
@@ -120,9 +120,13 @@ function Inner({
|
||||
color="primary"
|
||||
style={[a.justify_center]}
|
||||
onPress={() => {
|
||||
logger.metric('verification:learn-more', {
|
||||
location: 'verifierDialog',
|
||||
})
|
||||
logger.metric(
|
||||
'verification:learn-more',
|
||||
{
|
||||
location: 'verifierDialog',
|
||||
},
|
||||
{statsig: true},
|
||||
)
|
||||
}}>
|
||||
<ButtonText>
|
||||
<Trans>Learn more</Trans>
|
||||
|
||||
Reference in New Issue
Block a user