Event for show
This commit is contained in:
@@ -236,4 +236,9 @@ export type LogEvents = {
|
||||
'tmd:share': {}
|
||||
'tmd:download': {}
|
||||
'tmd:post': {}
|
||||
|
||||
'trendingTopics:show': {}
|
||||
'trendingTopics:hide': {
|
||||
context: 'sidebar' | 'discover' | 'explore'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user