Skip to content

Commit

Permalink
activate sw
Browse files Browse the repository at this point in the history
  • Loading branch information
nyakotey committed May 25, 2022
1 parent dc85dfd commit 833a0a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,14 @@ 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));
});

// }
}

4 changes: 2 additions & 2 deletions sw.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// #5

const staticCacheName = 'site-static-v53';
const dynamicCache = 'site-dynamic-v53';
const staticCacheName = 'site-static-v54';
const dynamicCache = 'site-dynamic-v54';

const dynamicCacheSize = 30;

Expand Down

0 comments on commit 833a0a2

Please sign in to comment.