diff options
author | Eric Bailey <git@esb.lol> | 2023-11-09 20:35:17 -0600 |
---|---|---|
committer | Eric Bailey <git@esb.lol> | 2023-11-09 20:35:17 -0600 |
commit | ab878ba9a6afaa57805aeab988b01c5b47bc9286 (patch) | |
tree | 266f68581a5d237b0d22b4b94fb92e0e45c0993b /src/view/com/auth/withAuthRequired.tsx | |
parent | 487d871cfd89948f4db9944c4bb414d268a56537 (diff) | |
download | voidsky-ab878ba9a6afaa57805aeab988b01c5b47bc9286.tar.zst |
Web login/signup and shell
Diffstat (limited to 'src/view/com/auth/withAuthRequired.tsx')
-rw-r--r-- | src/view/com/auth/withAuthRequired.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/view/com/auth/withAuthRequired.tsx b/src/view/com/auth/withAuthRequired.tsx index 898f81051..4b8b31d6c 100644 --- a/src/view/com/auth/withAuthRequired.tsx +++ b/src/view/com/auth/withAuthRequired.tsx @@ -6,7 +6,6 @@ import { TouchableOpacity, } from 'react-native' import {observer} from 'mobx-react-lite' -import {useStores} from 'state/index' import {CenteredView} from '../util/Views' import {LoggedOut} from './LoggedOut' import {Onboarding} from './Onboarding' @@ -14,17 +13,18 @@ import {Text} from '../util/text/Text' import {usePalette} from 'lib/hooks/usePalette' import {STATUS_PAGE_URL} from 'lib/constants' import {useOnboardingState} from '#/state/shell' +import {useSession} from '#/state/session' export const withAuthRequired = <P extends object>( Component: React.ComponentType<P>, ): React.FC<P> => observer(function AuthRequired(props: P) { - const store = useStores() + const {isInitialLoad, hasSession} = useSession() const onboardingState = useOnboardingState() - if (store.session.isResumingSession) { + if (isInitialLoad) { return <Loading /> } - if (!store.session.hasSession) { + if (!hasSession) { return <LoggedOut /> } if (onboardingState.isActive) { |