diff --git a/static/styles/find-code.css b/static/styles/find-code.css index 46bf36e..6a35c47 100644 --- a/static/styles/find-code.css +++ b/static/styles/find-code.css @@ -1,7 +1,5 @@ /*Overrides*/ .titleimg{ - height: 200px; - width: 234.38px; padding-bottom: 0px; } .small-lookup-box{ diff --git a/static/sw.js b/static/sw.js index 46ebdf1..71afb58 100644 --- a/static/sw.js +++ b/static/sw.js @@ -1,16 +1,16 @@ -/* Service Worker */ +/* Service Worker */ const appVersion = "0.0.1-dev" -const cacheName = "owlboard0-0-1-dev" +const cacheName = `owlboard-${appVersion}` +const cacheIDs = [cacheName] const cacheFiles = [ "/404.html", - "/board.html", "/conn-err.html", - "/find-code.html", "/help.html", "/", "/issue.html", "/settings.html", + "/manifest.json", "/styles/fonts/firamono/firamono-500.woff2", "/styles/fonts/firamono/firamono-regular.woff2", "/styles/fonts/urwgothic/urwgothic.woff2", @@ -50,13 +50,24 @@ self.addEventListener("install", (e) => { e.respondWith( (async () => { const r = await caches.match(e.request); - console.log(`[Service Worker] Fetching resource: ${e.request.url}`); if (r) { return r; } const response = await fetch(e.request); - console.log(`[Service Worker] Fetching from server: ${e.request.url}`); + console.log(`[Service Worker] Not cached - fetching from server: ${e.request.url}`); return response; })() ); + }); + + self.addEventListener('activate', function (event) { + event.waitUntil(caches.keys().then(function (keys) { + return Promise.all(keys.filter(function (key) { + return !cacheIDs.includes(key); + }).map(function (key) { + return caches.delete(key); + })); + }).then(function () { + return self.clients.claim(); + })); }); \ No newline at end of file