Skip to content

Commit

Permalink
activate service worker
Browse files Browse the repository at this point in the history
  • Loading branch information
Rdjarbeng committed May 7, 2022
1 parent 2ac701a commit 11c0ad7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ addWhatappEventHandler();

// service worker

// if('serviceWorker' in navigator){
// window.addEventListener('load', () => {
// navigator.serviceWorker.register('/sw.js')
// .then( (reg)=>{
// console.log('service worker registered', reg)
// })
// .catch((err)=> console.log('Service worker not registered', err));
// });
if('serviceWorker' in navigator){
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js')
.then( (reg)=>{
console.log('service worker registered', reg)
})
.catch((err)=> console.log('Service worker not registered', err));
});

// }
}

0 comments on commit 11c0ad7

Please sign in to comment.