From 6335be14e17c7bf1a36e9103148277717e3a7a90 Mon Sep 17 00:00:00 2001
From: dan <dan.abramov@gmail.com>
Date: Wed, 6 Dec 2023 20:04:05 +0000
Subject: 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
---
 src/App.web.tsx | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(limited to 'src/App.web.tsx')

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>
-- 
cgit 1.4.1

