Skip to content

Commit

Permalink
fix: catch service worker unregistration rejection (#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
mediremi committed Mar 24, 2021
1 parent 9c812c2 commit e1cbf3e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions shell/src/serviceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,15 @@ 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 during service worker unregistration:',
error
)
})
}
}

0 comments on commit e1cbf3e

Please sign in to comment.