Event for show

This commit is contained in:
Eric Bailey
2024-12-18 13:32:56 -06:00
parent 46699d5c37
commit a4a1e2ac19
2 changed files with 11 additions and 1 deletions
+5
View File
@@ -236,4 +236,9 @@ export type LogEvents = {
'tmd:share': {}
'tmd:download': {}
'tmd:post': {}
'trendingTopics:show': {}
'trendingTopics:hide': {
context: 'sidebar' | 'discover' | 'explore'
}
}
+6 -1
View File
@@ -1,5 +1,6 @@
import React from 'react'
import {logEvent} from '#/lib/statsig/statsig'
import * as persisted from '#/state/persisted'
type StateContext = {
@@ -26,7 +27,11 @@ function usePersistedBooleanValue<T extends keyof persisted.Schema>(key: T) {
(value: Exclude<persisted.Schema[T], undefined>) => void
>(
hidden => {
_set(Boolean(hidden))
const hide = Boolean(hidden)
if (!hide) {
logEvent('trendingTopics:show', {})
}
_set(hide)
persisted.write(key, hidden)
},
[key, _set],