[Experiment] Always show bottom bar (#4946)

This commit is contained in:
dan 2024-08-16 20:06:55 +01:00 committed by GitHub
parent a5af24b53b
commit 40ab67fc4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 1 deletions

View file

@ -7,6 +7,7 @@ import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
import {useSetTitle} from '#/lib/hooks/useSetTitle'
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
import {logEvent, LogEvents} from '#/lib/statsig/statsig'
import {useGate} from '#/lib/statsig/statsig'
import {emitSoftReset} from '#/state/events'
import {SavedFeedSourceInfo, usePinnedFeedsInfos} from '#/state/queries/feed'
import {FeedDescriptor, FeedParams} from '#/state/queries/post-feed'
@ -88,6 +89,7 @@ function HomeScreenReady({
const selectedFeed = allFeeds[selectedIndex]
const requestNotificationsPermission = useRequestNotificationsPermission()
const triggerTourIfQueued = useTriggerTourIfQueued(TOURS.HOME)
const gate = useGate()
useSetTitle(pinnedFeedInfos[selectedIndex]?.displayName)
useOTAUpdates()
@ -169,6 +171,10 @@ function HomeScreenReady({
const {isMobile} = useWebMediaQueries()
useFocusEffect(
React.useCallback(() => {
if (gate('fixed_bottom_bar')) {
// Unnecessary because it's always there.
return
}
const listener = AppState.addEventListener('change', nextAppState => {
if (nextAppState === 'active') {
if (isMobile && mode.value === 1) {
@ -181,7 +187,7 @@ function HomeScreenReady({
return () => {
listener.remove()
}
}, [setMinimalShellMode, mode, isMobile]),
}, [setMinimalShellMode, mode, isMobile, gate]),
)
const onPageSelected = React.useCallback(