diff --git a/view/js/sw.js b/view/js/sw.js index 72fdcd9a1..c18e90e30 100644 --- a/view/js/sw.js +++ b/view/js/sw.js @@ -1,25 +1,30 @@ -self.addEventListener('install', (e) => { - /* - e.waitUntil( - caches.open('fox-store').then((cache) => cache.addAll([ - '/pwa-examples/a2hs/', - '/pwa-examples/a2hs/index.html', - '/pwa-examples/a2hs/index.js', - '/pwa-examples/a2hs/style.css', - '/pwa-examples/a2hs/images/fox1.jpg', - '/pwa-examples/a2hs/images/fox2.jpg', - '/pwa-examples/a2hs/images/fox3.jpg', - '/pwa-examples/a2hs/images/fox4.jpg', - ])), - ); - * - */ - console.log('sw.js 1',e); +/* + self.addEventListener('install', (e) => { + e.waitUntil( + caches.open('fox-store').then((cache) => cache.addAll([ + '/pwa-examples/a2hs/', + '/pwa-examples/a2hs/index.html', + '/pwa-examples/a2hs/index.js', + '/pwa-examples/a2hs/style.css', + '/pwa-examples/a2hs/images/fox1.jpg', + '/pwa-examples/a2hs/images/fox2.jpg', + '/pwa-examples/a2hs/images/fox3.jpg', + '/pwa-examples/a2hs/images/fox4.jpg', + ])), + ); + console.log('sw.js 1',e); + }); + * + */ + + +self.addEventListener('install', event => { + event.waitUntil(Promise.all([self.skipWaiting()])); }); self.addEventListener('fetch', (e) => { - console.log('sw.js 2',e.request.url); - e.respondWith( - caches.match(e.request).then((response) => response || fetch(e.request)), - ); + console.log('sw.js 2', e.request.url); + e.respondWith( + caches.match(e.request).then((response) => response || fetch(e.request)), + ); }); \ No newline at end of file