Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Only run "disable min shell on foregrounding" behaviour if on the home screen (#3825)

* change useEffect to useFocusEffect

* v2 -> v3

authored by

Samuel Newman and committed by
GitHub
6da18e3d 96c5db3e

+17 -15
+1 -1
src/lib/statsig/gates.ts
··· 1 1 export type Gate = 2 2 // Keep this alphabetic please. 3 3 | 'autoexpand_suggestions_on_profile_follow_v2' 4 - | 'disable_min_shell_on_foregrounding_v2' 4 + | 'disable_min_shell_on_foregrounding_v3' 5 5 | 'disable_poll_on_discover_v2' 6 6 | 'dms' 7 7 | 'hide_vertical_scroll_indicators'
+16 -14
src/view/screens/Home.tsx
··· 119 119 const gate = useGate() 120 120 const mode = useMinimalShellMode() 121 121 const {isMobile} = useWebMediaQueries() 122 - React.useEffect(() => { 123 - const listener = AppState.addEventListener('change', nextAppState => { 124 - if (nextAppState === 'active') { 125 - if ( 126 - isMobile && 127 - mode.value === 1 && 128 - gate('disable_min_shell_on_foregrounding_v2') 129 - ) { 130 - setMinimalShellMode(false) 122 + useFocusEffect( 123 + React.useCallback(() => { 124 + const listener = AppState.addEventListener('change', nextAppState => { 125 + if (nextAppState === 'active') { 126 + if ( 127 + isMobile && 128 + mode.value === 1 && 129 + gate('disable_min_shell_on_foregrounding_v3') 130 + ) { 131 + setMinimalShellMode(false) 132 + } 131 133 } 134 + }) 135 + return () => { 136 + listener.remove() 132 137 } 133 - }) 134 - return () => { 135 - listener.remove() 136 - } 137 - }, [setMinimalShellMode, mode, isMobile, gate]) 138 + }, [setMinimalShellMode, mode, isMobile, gate]), 139 + ) 138 140 139 141 const onPageSelected = React.useCallback( 140 142 (index: number) => {