From b67982a90f861ba29e41ed366a481af707bd1c79 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Fri, 13 May 2022 17:12:16 -0700 Subject: web: use icons for settings; misc changes --- web/static/sw.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'web/static/sw.js') diff --git a/web/static/sw.js b/web/static/sw.js index f5d699a..6359ae5 100644 --- a/web/static/sw.js +++ b/web/static/sw.js @@ -1,8 +1,8 @@ const CACHE_PREFIX = 'dartboat-' -const CACHE_VERSION = '3'; +const CACHE_VERSION = '4'; const CACHE_NAME = `${CACHE_PREFIX}${CACHE_VERSION}`; -const FILES = [ +const CACHE_FILES = [ './', 'style.css', 'dartboat.js', @@ -18,19 +18,16 @@ function swlog(str) { self.addEventListener('install', e => { swlog('installing'); - - e.waitUntil((async() => { + e.waitUntil((async () => { swlog(`initialising cache ${CACHE_NAME}`); const cache = await caches.open(CACHE_NAME); - await cache.addAll(FILES); + await cache.addAll(CACHE_FILES); })()); - - swlog('installed'); }); self.addEventListener('activate', e => { - e.waitUntil(caches.keys().then((keys) => { - return Promise.all(keys.map((k) => { + e.waitUntil(caches.keys().then(keys => { + return Promise.all(keys.map(k => { if (k === CACHE_NAME || !k.startsWith(CACHE_PREFIX)) return; -- cgit v1.2.3-70-g09d2