diff options
Diffstat (limited to 'src/App.web.tsx')
-rw-r--r-- | src/App.web.tsx | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/src/App.web.tsx b/src/App.web.tsx index e1f4e8030..67fa3dcc3 100644 --- a/src/App.web.tsx +++ b/src/App.web.tsx @@ -1,7 +1,6 @@ import 'lib/sentry' // must be near top import React, {useState, useEffect} from 'react' -import {observer} from 'mobx-react-lite' import {QueryClientProvider} from '@tanstack/react-query' import {SafeAreaProvider} from 'react-native-safe-area-context' import {RootSiblingParent} from 'react-native-root-siblings' @@ -12,7 +11,6 @@ import {init as initPersistedState} from '#/state/persisted' import {init as initReminders} from '#/state/shell/reminders' import {useColorMode} from 'state/shell' import * as analytics from 'lib/analytics/analytics' -import {RootStoreModel, setupState, RootStoreProvider} from './state' import {Shell} from 'view/shell/index' import {ToastContainer} from 'view/com/util/Toast.web' import {ThemeProvider} from 'lib/ThemeContext' @@ -34,22 +32,13 @@ import { import {Provider as UnreadNotifsProvider} from 'state/queries/notifications/unread' import * as persisted from '#/state/persisted' -const InnerApp = observer(function AppImpl() { +function InnerApp() { const {isInitialLoad} = useSession() const {resumeSession} = useSessionApi() const colorMode = useColorMode() - const [rootStore, setRootStore] = useState<RootStoreModel | undefined>( - undefined, - ) // init useEffect(() => { - setupState().then(store => { - setRootStore(store) - }) - }, []) - - useEffect(() => { initReminders() analytics.init() dynamicActivate(defaultLocale) // async import of locale data @@ -59,7 +48,7 @@ const InnerApp = observer(function AppImpl() { }, [resumeSession]) // show nothing prior to init - if (!rootStore || isInitialLoad) { + if (isInitialLoad) { // TODO add a loading state return null } @@ -72,22 +61,20 @@ const InnerApp = observer(function AppImpl() { <UnreadNotifsProvider> <ThemeProvider theme={colorMode}> <analytics.Provider> - <RootStoreProvider value={rootStore}> - <I18nProvider i18n={i18n}> - {/* All components should be within this provider */} - <RootSiblingParent> - <SafeAreaProvider> - <Shell /> - </SafeAreaProvider> - </RootSiblingParent> - </I18nProvider> - <ToastContainer /> - </RootStoreProvider> + <I18nProvider i18n={i18n}> + {/* All components should be within this provider */} + <RootSiblingParent> + <SafeAreaProvider> + <Shell /> + </SafeAreaProvider> + </RootSiblingParent> + </I18nProvider> + <ToastContainer /> </analytics.Provider> </ThemeProvider> </UnreadNotifsProvider> ) -}) +} function App() { const [isReady, setReady] = useState(false) |