Track notification open (#3274)

zio/stable
dan 2024-03-19 20:19:11 +00:00 committed by GitHub
parent 0cac671e8a
commit ebf8644df9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import {logger} from '#/logger'
import {RQKEY as RQKEY_NOTIFS} from '#/state/queries/notifications/feed' import {RQKEY as RQKEY_NOTIFS} from '#/state/queries/notifications/feed'
import {truncateAndInvalidate} from '#/state/queries/util' import {truncateAndInvalidate} from '#/state/queries/util'
import {SessionAccount, getAgent} from '#/state/session' import {SessionAccount, getAgent} from '#/state/session'
import {logEvent} from '../statsig/statsig'
const SERVICE_DID = (serviceUrl?: string) => const SERVICE_DID = (serviceUrl?: string) =>
serviceUrl?.includes('staging') serviceUrl?.includes('staging')
@ -123,6 +124,7 @@ export function init(queryClient: QueryClient) {
logger.DebugContext.notifications, logger.DebugContext.notifications,
) )
track('Notificatons:OpenApp') track('Notificatons:OpenApp')
logEvent('notifications:openApp', {})
truncateAndInvalidate(queryClient, RQKEY_NOTIFS()) truncateAndInvalidate(queryClient, RQKEY_NOTIFS())
resetToTab('NotificationsTab') // open notifications tab resetToTab('NotificationsTab') // open notifications tab
} }

View File

@ -2,6 +2,7 @@ export type LogEvents = {
init: { init: {
initMs: number initMs: number
} }
'notifications:openApp': {}
'state:background': {} 'state:background': {}
'state:foreground': {} 'state:foreground': {}
'feed:endReached': { 'feed:endReached': {