diff --git a/native/data/sqlite-context-provider.js b/native/data/sqlite-context-provider.js --- a/native/data/sqlite-context-provider.js +++ b/native/data/sqlite-context-provider.js @@ -7,6 +7,7 @@ import { setMessageStoreMessages } from 'lib/actions/message-actions.js'; import { setThreadStoreActionType } from 'lib/actions/thread-actions'; +import { isLoggedIn } from 'lib/selectors/user-selectors'; import { logInActionSources } from 'lib/types/account-types'; import { fetchNewCookieFromNativeCredentials } from 'lib/utils/action-utils'; import { getMessageForException } from 'lib/utils/errors'; @@ -31,11 +32,16 @@ const cookie = useSelector(state => state.cookie); const urlPrefix = useSelector(state => state.urlPrefix); const staffCanSee = useStaffCanSee(); + const loggedIn = useSelector(isLoggedIn); React.useEffect(() => { if (storeLoaded || !rehydrateConcluded) { return; } + if (!loggedIn) { + setStoreLoaded(true); + return; + } (async () => { try { const [threads, messages] = await Promise.all([ @@ -86,6 +92,7 @@ } })(); }, [ + loggedIn, cookie, dispatch, rehydrateConcluded,