about summary refs log tree commit diff
path: root/src/App.native.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.native.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.native.tsx')
-rw-r--r--src/App.native.tsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/App.native.tsx b/src/App.native.tsx
index 5ffbb6a82..442d7fe58 100644
--- a/src/App.native.tsx
+++ b/src/App.native.tsx
@@ -16,7 +16,7 @@ import {ThemeProvider} from 'lib/ThemeContext'
 import {s} from 'lib/styles'
 import {Shell} from 'view/shell'
 import * as notifications from 'lib/notifications/notifications'
-import * as analytics from 'lib/analytics/analytics'
+import {Provider as AnalyticsProvider} from 'lib/analytics/analytics'
 import * as Toast from 'view/com/util/Toast'
 import {queryClient} from 'lib/react-query'
 import {TestCtrls} from 'view/com/testing/TestCtrls'
@@ -45,7 +45,6 @@ function InnerApp() {
 
   // init
   useEffect(() => {
-    analytics.init()
     notifications.init(queryClient)
     listenSessionDropped(() => {
       Toast.show('Sorry! Your session expired. Please log in again.')
@@ -72,7 +71,7 @@ function InnerApp() {
       <LoggedOutViewProvider>
         <UnreadNotifsProvider>
           <ThemeProvider theme={colorMode}>
-            <analytics.Provider>
+            <AnalyticsProvider>
               {/* All components should be within this provider */}
               <RootSiblingParent>
                 <GestureHandlerRootView style={s.h100pct}>
@@ -80,7 +79,7 @@ function InnerApp() {
                   <Shell />
                 </GestureHandlerRootView>
               </RootSiblingParent>
-            </analytics.Provider>
+            </AnalyticsProvider>
           </ThemeProvider>
         </UnreadNotifsProvider>
       </LoggedOutViewProvider>