fix: auto-reload page when new service worker is available
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 19s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 19s
This commit is contained in:
parent
bb860044dd
commit
c76b5e7d9c
@ -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 } },
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user