prettified service worker

This commit is contained in:
antelle 2019-09-23 20:36:54 +02:00
parent a01d85411c
commit 6aca16c336
1 changed files with 8 additions and 8 deletions

View File

@ -1,16 +1,16 @@
const VERSION = '0.0.0';
self.addEventListener('install', event => {
self.addEventListener('install', event =>
event.waitUntil(
caches.open('v1').then(cache => {
return fetch('.?v=' + VERSION).then(response => {
caches.open('v1').then(cache =>
fetch('.?v=' + VERSION).then(response => {
if (response.ok) {
cache.put('.', response);
return cache.put('.', response);
}
});
})
);
});
})
)
)
);
self.addEventListener('fetch', event => {
event.respondWith(