aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modern/src/App.jsx2
-rw-r--r--modern/src/ReloadPrompt.tsx7
-rw-r--r--modern/src/index.jsx2
3 files changed, 3 insertions, 8 deletions
diff --git a/modern/src/App.jsx b/modern/src/App.jsx
index 89785cfa..3e491d49 100644
--- a/modern/src/App.jsx
+++ b/modern/src/App.jsx
@@ -8,6 +8,7 @@ import SocketController from './SocketController';
import CachingController from './CachingController';
import { useEffectAsync } from './reactHelper';
import { sessionActions } from './store';
+import ReloadPrompt from './ReloadPrompt';
const useStyles = makeStyles(() => ({
page: {
@@ -48,6 +49,7 @@ const App = () => {
<>
<SocketController />
<CachingController />
+ <ReloadPrompt />
<div className={classes.page}>
<Outlet />
</div>
diff --git a/modern/src/ReloadPrompt.tsx b/modern/src/ReloadPrompt.tsx
index 1f93f913..3aa7ca42 100644
--- a/modern/src/ReloadPrompt.tsx
+++ b/modern/src/ReloadPrompt.tsx
@@ -1,17 +1,14 @@
import { Snackbar, Button } from '@mui/material';
import React from 'react'
import { useTranslation } from './common/components/LocalizationProvider';
-
import { useAttributePreference } from './common/util/preferences';
-
import { useRegisterSW } from 'virtual:pwa-register/react'
// Based on https://vite-pwa-org.netlify.app/frameworks/react.html
function ReloadPrompt() {
const t = useTranslation();
- // const serviceWorkerUpdateInterval = useAttributePreference('serviceWorkerUpdateInterval', 3600000);
- const serviceWorkerUpdateInterval = 60000;
+ const serviceWorkerUpdateInterval = useAttributePreference('serviceWorkerUpdateInterval', 3600000);
const {
offlineReady: [offlineReady, setOfflineReady],
@@ -19,8 +16,6 @@ function ReloadPrompt() {
updateServiceWorker,
} = useRegisterSW({
onRegisteredSW(swUrl, r) {
- console.log('serviceWorkerUpdateCheck', serviceWorkerUpdateInterval);
-
serviceWorkerUpdateInterval > 0 && r && setInterval(async () => {
if (!(!r.installing && navigator)) {
return;
diff --git a/modern/src/index.jsx b/modern/src/index.jsx
index 0c342b23..3eb96d2f 100644
--- a/modern/src/index.jsx
+++ b/modern/src/index.jsx
@@ -16,7 +16,6 @@ import NativeInterface from './common/components/NativeInterface';
import ServerProvider from './ServerProvider';
import ErrorBoundary from './ErrorBoundary';
import AppThemeProvider from './AppThemeProvider';
-import ReloadPrompt from './ReloadPrompt';
preloadImages();
@@ -32,7 +31,6 @@ root.render(
<BrowserRouter>
<Navigation />
</BrowserRouter>
- <ReloadPrompt />
<ErrorHandler />
<NativeInterface />
</ServerProvider>