[Statsig] Make gate checks lazily (#3594)

This commit is contained in:
dan 2024-04-18 04:39:29 +01:00 committed by GitHub
parent 086dc93a7a
commit 02becdf449
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 67 additions and 62 deletions

View file

@ -31,8 +31,8 @@ async function setExtraParams() {
}
export function useOTAUpdates() {
const shouldReceiveUpdates =
useGate('receive_updates') && isEnabled && !__DEV__
const gate = useGate()
const shouldReceiveUpdates = isEnabled && !__DEV__ && gate('receive_updates')
const appState = React.useRef<AppStateStatus>('active')
const lastMinimize = React.useRef(0)