diff --git a/src/lib/statsig/gates.ts b/src/lib/statsig/gates.ts index 5cd603920e..99706de661 100644 --- a/src/lib/statsig/gates.ts +++ b/src/lib/statsig/gates.ts @@ -1,7 +1,7 @@ export type Gate = // Keep this alphabetic please. | 'autoexpand_suggestions_on_profile_follow_v2' - | 'disable_min_shell_on_foregrounding_v2' + | 'disable_min_shell_on_foregrounding_v3' | 'disable_poll_on_discover_v2' | 'dms' | 'hide_vertical_scroll_indicators' diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index 3eaa1b8757..665400f14d 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -119,22 +119,24 @@ function HomeScreenReady({ const gate = useGate() const mode = useMinimalShellMode() const {isMobile} = useWebMediaQueries() - React.useEffect(() => { - const listener = AppState.addEventListener('change', nextAppState => { - if (nextAppState === 'active') { - if ( - isMobile && - mode.value === 1 && - gate('disable_min_shell_on_foregrounding_v2') - ) { - setMinimalShellMode(false) + useFocusEffect( + React.useCallback(() => { + const listener = AppState.addEventListener('change', nextAppState => { + if (nextAppState === 'active') { + if ( + isMobile && + mode.value === 1 && + gate('disable_min_shell_on_foregrounding_v3') + ) { + setMinimalShellMode(false) + } } + }) + return () => { + listener.remove() } - }) - return () => { - listener.remove() - } - }, [setMinimalShellMode, mode, isMobile, gate]) + }, [setMinimalShellMode, mode, isMobile, gate]), + ) const onPageSelected = React.useCallback( (index: number) => {