mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 15:06:15 -04:00
Update service-worker.js
This commit is contained in:
parent
f21d7a1418
commit
2349d0b20b
1 changed files with 19 additions and 0 deletions
|
@ -33,3 +33,22 @@ self.addEventListener('fetch', function(event) {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
self.addEventListener('activate', function(event) {
|
||||||
|
console.log('Updating Service Worker...')
|
||||||
|
event.waitUntil(
|
||||||
|
caches.keys().then(function(cacheNames) {
|
||||||
|
return Promise.all(
|
||||||
|
cacheNames.filter(function(cacheName) {
|
||||||
|
// Return true if you want to remove this cache,
|
||||||
|
// but remember that caches are shared across
|
||||||
|
// the whole origin
|
||||||
|
return true
|
||||||
|
}).map(function(cacheName) {
|
||||||
|
return caches.delete(cacheName);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue