Refactor minimal shell mode to refcounting (#10319)
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
||||
useLoggedOutView,
|
||||
useLoggedOutViewControls,
|
||||
} from '#/state/shell/logged-out'
|
||||
import {useSetMinimalShellMode} from '#/state/shell/minimal-mode'
|
||||
import {useEnableMinimalShellMode} from '#/state/shell/minimal-mode'
|
||||
import {ErrorBoundary} from '#/view/com/util/ErrorBoundary'
|
||||
import {Login} from '#/screens/Login'
|
||||
import {Signup} from '#/screens/Signup'
|
||||
@@ -37,7 +37,7 @@ export function LoggedOut({onDismiss}: {onDismiss?: () => void}) {
|
||||
const ax = useAnalytics()
|
||||
const t = useTheme()
|
||||
const insets = useSafeAreaInsets()
|
||||
const setMinimalShellMode = useSetMinimalShellMode()
|
||||
useEnableMinimalShellMode()
|
||||
const {requestedAccountSwitchTo} = useLoggedOutView()
|
||||
const [screenState, setScreenState] = useState<ScreenState>(() => {
|
||||
if (requestedAccountSwitchTo === 'new') {
|
||||
@@ -68,10 +68,6 @@ export function LoggedOut({onDismiss}: {onDismiss?: () => void}) {
|
||||
})
|
||||
}, [accounts, agent, queryClient])
|
||||
|
||||
useEffect(() => {
|
||||
setMinimalShellMode(true)
|
||||
}, [setMinimalShellMode])
|
||||
|
||||
const onPressDismiss = useCallback(() => {
|
||||
if (onDismiss) {
|
||||
onDismiss()
|
||||
|
||||
@@ -30,7 +30,6 @@ import {
|
||||
} from '#/state/queries/post-feed'
|
||||
import {truncateAndInvalidate} from '#/state/queries/util'
|
||||
import {useSession} from '#/state/session'
|
||||
import {useSetMinimalShellMode} from '#/state/shell'
|
||||
import {useHeaderOffset} from '#/components/hooks/useHeaderOffset'
|
||||
import {useAnalytics} from '#/analytics'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
@@ -70,7 +69,6 @@ export function FeedPage({
|
||||
const queryClient = useQueryClient()
|
||||
const {openComposer} = useOpenComposer()
|
||||
const [isScrolledDown, setIsScrolledDown] = useState(false)
|
||||
const setMinimalShellMode = useSetMinimalShellMode()
|
||||
const headerOffset = useHeaderOffset()
|
||||
const feedFeedback = useFeedFeedback(feedInfo, hasSession)
|
||||
const scrollElRef = useRef<ListMethods>(null)
|
||||
@@ -95,8 +93,7 @@ export function FeedPage({
|
||||
animated: IS_NATIVE,
|
||||
offset: -headerOffset,
|
||||
})
|
||||
setMinimalShellMode(false)
|
||||
}, [headerOffset, setMinimalShellMode])
|
||||
}, [headerOffset])
|
||||
|
||||
const onSoftReset = useCallback(() => {
|
||||
const isScreenFocused =
|
||||
|
||||
Reference in New Issue
Block a user