fix(service-worker): Install service worker correctly (#222)
* fix(service-worker): register service worker immediately
This commit is contained in:
parent
d697aa0482
commit
d546fef71c
@ -31,7 +31,6 @@ export function register(config) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('load', () => {
|
|
||||||
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`
|
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`
|
||||||
|
|
||||||
if (isLocalhost) {
|
if (isLocalhost) {
|
||||||
@ -50,7 +49,6 @@ export function register(config) {
|
|||||||
// Is not localhost. Just register service worker
|
// Is not localhost. Just register service worker
|
||||||
registerValidSW(swUrl, config)
|
registerValidSW(swUrl, config)
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user