about summary refs log tree commit diff
path: root/src/App.web.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2023-12-06 20:04:05 +0000
committerGitHub <noreply@github.com>2023-12-06 12:04:05 -0800
commit6335be14e17c7bf1a36e9103148277717e3a7a90 (patch)
treec10f139dc2507a38bb3c58819cc19382279a675f /src/App.web.tsx
parent748212e000f963976bca5d63e0961d75a7e8b296 (diff)
downloadvoidsky-6335be14e17c7bf1a36e9103148277717e3a7a90.tar.zst
Move analytics out of init (#2115)
* Remove listenSessionLoaded from analytics

* Move analytics init call to navigation ready

* Remove zod dependency from analytics

* Mirror changes on the web

* Delete listenSessionLoaded

* Only set up listeners once
Diffstat (limited to 'src/App.web.tsx')
-rw-r--r--src/App.web.tsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/App.web.tsx b/src/App.web.tsx
index 74702dca2..371153209 100644
--- a/src/App.web.tsx
+++ b/src/App.web.tsx
@@ -9,7 +9,7 @@ import 'view/icons'
 
 import {init as initPersistedState} from '#/state/persisted'
 import {useColorMode} from 'state/shell'
-import * as analytics from 'lib/analytics/analytics'
+import {Provider as AnalyticsProvider} from 'lib/analytics/analytics'
 import {Shell} from 'view/shell/index'
 import {ToastContainer} from 'view/com/util/Toast.web'
 import {ThemeProvider} from 'lib/ThemeContext'
@@ -37,7 +37,6 @@ function InnerApp() {
 
   // init
   useEffect(() => {
-    analytics.init()
     const account = persisted.get('session').currentAccount
     resumeSession(account)
   }, [resumeSession])
@@ -59,7 +58,7 @@ function InnerApp() {
       <LoggedOutViewProvider>
         <UnreadNotifsProvider>
           <ThemeProvider theme={colorMode}>
-            <analytics.Provider>
+            <AnalyticsProvider>
               {/* All components should be within this provider */}
               <RootSiblingParent>
                 <SafeAreaProvider>
@@ -67,7 +66,7 @@ function InnerApp() {
                 </SafeAreaProvider>
               </RootSiblingParent>
               <ToastContainer />
-            </analytics.Provider>
+            </AnalyticsProvider>
           </ThemeProvider>
         </UnreadNotifsProvider>
       </LoggedOutViewProvider>