From 02becdf4491cded0f0435e880e1ad4030d500403 Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 18 Apr 2024 04:39:29 +0100 Subject: [Statsig] Make gate checks lazily (#3594) --- src/lib/hooks/useOTAUpdates.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/hooks/useOTAUpdates.ts') diff --git a/src/lib/hooks/useOTAUpdates.ts b/src/lib/hooks/useOTAUpdates.ts index 70905c137..b8d331c6f 100644 --- a/src/lib/hooks/useOTAUpdates.ts +++ b/src/lib/hooks/useOTAUpdates.ts @@ -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('active') const lastMinimize = React.useRef(0) -- cgit 1.4.1