about summary refs log tree commit diff
path: root/src/lib/hooks/useOTAUpdate.ts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-11-04 13:42:36 -0500
committerEric Bailey <git@esb.lol>2023-11-04 13:42:36 -0500
commitf51351e80d446fc058faf0ab91757ca4bdead0a5 (patch)
tree0c2372a71e605bfbb99b38113305b800ddd04064 /src/lib/hooks/useOTAUpdate.ts
parente49a3d8a564b2aa42a8c0e66dfcbae27d096dc26 (diff)
downloadvoidsky-f51351e80d446fc058faf0ab91757ca4bdead0a5.tar.zst
Replace all logs with new logger
Diffstat (limited to 'src/lib/hooks/useOTAUpdate.ts')
-rw-r--r--src/lib/hooks/useOTAUpdate.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/hooks/useOTAUpdate.ts b/src/lib/hooks/useOTAUpdate.ts
index d7855b2d4..0ce97a4c8 100644
--- a/src/lib/hooks/useOTAUpdate.ts
+++ b/src/lib/hooks/useOTAUpdate.ts
@@ -2,6 +2,7 @@ import * as Updates from 'expo-updates'
 import {useCallback, useEffect} from 'react'
 import {AppState} from 'react-native'
 import {useStores} from 'state/index'
+import {logger} from '#/logger'
 
 export function useOTAUpdate() {
   const store = useStores()
@@ -21,7 +22,7 @@ export function useOTAUpdate() {
     })
   }, [store.shell])
   const checkForUpdate = useCallback(async () => {
-    store.log.debug('useOTAUpdate: Checking for update...')
+    logger.debug('useOTAUpdate: Checking for update...')
     try {
       // Check if new OTA update is available
       const update = await Updates.checkForUpdateAsync()
@@ -34,16 +35,16 @@ export function useOTAUpdate() {
       // show a popup modal
       showUpdatePopup()
     } catch (e) {
-      store.log.error('useOTAUpdate: Error while checking for update', {
+      logger.error('useOTAUpdate: Error while checking for update', {
         error: e,
       })
     }
-  }, [showUpdatePopup, store.log])
+  }, [showUpdatePopup])
   const updateEventListener = useCallback(
     (event: Updates.UpdateEvent) => {
-      store.log.debug('useOTAUpdate: Listening for update...')
+      logger.debug('useOTAUpdate: Listening for update...')
       if (event.type === Updates.UpdateEventType.ERROR) {
-        store.log.error('useOTAUpdate: Error while listening for update', {
+        logger.error('useOTAUpdate: Error while listening for update', {
           message: event.message,
         })
       } else if (event.type === Updates.UpdateEventType.NO_UPDATE_AVAILABLE) {
@@ -55,7 +56,7 @@ export function useOTAUpdate() {
         showUpdatePopup()
       }
     },
-    [showUpdatePopup, store.log],
+    [showUpdatePopup],
   )
 
   useEffect(() => {