oneuptime/Home/public/service-worker.js
Nawaz Dhandala af298a39e4
fix types
2022-04-14 14:43:30 +01:00

31 lines
614 B
JavaScript

const cacheName: string = 'OneUptime-home';
const filesToCache = [];
self.addEventListener('install', function (event) {
self.skipWaiting();
});
self.addEventListener('activate', function (event) {
if (!event) { return }
event.waitUntil(
caches.keys().then(function (cacheNames) {
return Promise.all(
cacheNames.filter(function (cacheName) {
// return true if you want to delete this cache.
return true;
}).map(function (cacheName) {
return caches.delete(cacheName);
})
);
})
);
return self.clients.claim();
});