Update serviceWorker to the latest from create-react-app

This commit is contained in:
Deluan 2020-09-29 17:10:06 -04:00
parent bf93b5614c
commit ca283f45ea
1 changed files with 7 additions and 3 deletions

View File

@ -130,8 +130,12 @@ function checkValidServiceWorker(swUrl, config) {
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then((registration) => {
registration.unregister()
})
navigator.serviceWorker.ready
.then((registration) => {
registration.unregister()
})
.catch((error) => {
console.error(error.message)
})
}
}