fix: auto-reload page when new service worker is available
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 19s

This commit is contained in:
ordinarthur 2026-04-12 22:14:22 +02:00
parent bb860044dd
commit c76b5e7d9c

View File

@ -2,9 +2,17 @@ import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { BrowserRouter } from 'react-router-dom'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { registerSW } from 'virtual:pwa-register'
import './index.css'
import App from './App'
// Auto-reload when a new service worker is available
registerSW({
onNeedRefresh() {
window.location.reload()
},
})
const queryClient = new QueryClient({
defaultOptions: { queries: { staleTime: 1000 * 60 * 5 } },
})