diff options
Diffstat (limited to 'src/lib/hooks/useOTAUpdate.ts')
-rw-r--r-- | src/lib/hooks/useOTAUpdate.ts | 13 |
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(() => { |