Some metrics (#7294)
* Add trending metrics * Progress guide events * Fix naming, improve existing events
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import React from 'react'
|
||||
|
||||
import {logEvent} from '#/lib/statsig/statsig'
|
||||
import * as persisted from '#/state/persisted'
|
||||
|
||||
type StateContext = {
|
||||
@@ -27,11 +26,7 @@ function usePersistedBooleanValue<T extends keyof persisted.Schema>(key: T) {
|
||||
(value: Exclude<persisted.Schema[T], undefined>) => void
|
||||
>(
|
||||
hidden => {
|
||||
const hide = Boolean(hidden)
|
||||
if (!hide) {
|
||||
logEvent('trendingTopics:show', {})
|
||||
}
|
||||
_set(hide)
|
||||
_set(Boolean(hidden))
|
||||
persisted.write(key, hidden)
|
||||
},
|
||||
[key, _set],
|
||||
|
||||
@@ -2,6 +2,7 @@ import React, {useMemo} from 'react'
|
||||
import {msg} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {logEvent} from '#/lib/statsig/statsig'
|
||||
import {
|
||||
ProgressGuideToast,
|
||||
ProgressGuideToastRef,
|
||||
@@ -137,6 +138,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
||||
endProgressGuide() {
|
||||
setLocalGuideState(undefined)
|
||||
mutateAsync(undefined)
|
||||
logEvent('progressGuide:hide', {})
|
||||
},
|
||||
|
||||
captureAction(action: ProgressGuideAction, count = 1) {
|
||||
|
||||
Reference in New Issue
Block a user