diff options
Diffstat (limited to 'modern/src/index.jsx')
-rw-r--r-- | modern/src/index.jsx | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/modern/src/index.jsx b/modern/src/index.jsx index 33524e97..0c342b23 100644 --- a/modern/src/index.jsx +++ b/modern/src/index.jsx @@ -16,33 +16,7 @@ import NativeInterface from './common/components/NativeInterface'; import ServerProvider from './ServerProvider'; import ErrorBoundary from './ErrorBoundary'; import AppThemeProvider from './AppThemeProvider'; -import { registerSW } from 'virtual:pwa-register' - -const ServiceWorkerUpdateCheckInterval = 60 * 60 * 1000; - -registerSW({ - onRegisteredSW(swUrl, r) { - r && setInterval(async () => { - if (!(!r.installing && navigator)) - return - - if (('connection' in navigator) && !navigator.onLine) - return - - const resp = await fetch(swUrl, { - cache: 'no-store', - headers: { - 'cache': 'no-store', - 'cache-control': 'no-cache', - }, - }) - - if (resp?.status === 200) - await r.update() - }, ServiceWorkerUpdateCheckInterval) - }, - immediate: true -}); +import ReloadPrompt from './ReloadPrompt'; preloadImages(); @@ -58,6 +32,7 @@ root.render( <BrowserRouter> <Navigation /> </BrowserRouter> + <ReloadPrompt /> <ErrorHandler /> <NativeInterface /> </ServerProvider> |