diff --git a/app/src/components/provider/UpdateProvider.tsx b/app/src/components/provider/UpdateProvider.tsx index 9d397fd27..030819213 100644 --- a/app/src/components/provider/UpdateProvider.tsx +++ b/app/src/components/provider/UpdateProvider.tsx @@ -4,15 +4,16 @@ import { logError } from '~/util/analytics'; import { AppState } from 'react-native'; import { showInfo } from './SnackbarProvider'; import { showWarning } from './SnackbarProvider'; +import { __WEB__ } from '~/util/config'; const onError = (error: unknown) => { showWarning('Failed to download update. You may experience issues.'); logError('Error encountered during update', { error }); }; -export const UpdateProvider = () => { +export function UpdateProvider() { useEffect(() => { - if (__DEV__) return; // Updates don't work in development mode as bundle is always served from server + if (__DEV__ || __WEB__) return; const onStartUpdateListener = Updates.addListener((e) => { if (e.type === Updates.UpdateEventType.UPDATE_AVAILABLE) { @@ -46,4 +47,4 @@ export const UpdateProvider = () => { }, []); return null; -}; +} diff --git a/app/src/util/config.ts b/app/src/util/config.ts index 3100c34d7..b5ccab0a3 100644 --- a/app/src/util/config.ts +++ b/app/src/util/config.ts @@ -2,6 +2,7 @@ import constants from 'expo-constants'; import type { Config } from '../../app.config'; import { Href } from 'expo-router'; import { resolveHref } from 'expo-router/src/link/href'; +import { Platform } from 'react-native'; export const CONFIG = constants.expoConfig!.extra as Config; @@ -18,3 +19,5 @@ export const getPathFromDeepLink = (link: string) => { const path = link.match(PATTERN)?.[1]; return path && `/${path}`; }; + +export const __WEB__ = Platform.OS === 'web';