summaryrefslogtreecommitdiff
path: root/web/static/sw.js
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-13 17:12:16 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-13 17:12:16 -0700
commitb67982a90f861ba29e41ed366a481af707bd1c79 (patch)
tree73b7d77b1428f5e8765b7e494465dd69b4465632 /web/static/sw.js
parent63337ba4f8c4f31b7da96e9c3669fc29e0a03b49 (diff)
downloaddartboat-b67982a90f861ba29e41ed366a481af707bd1c79.tar.gz
dartboat-b67982a90f861ba29e41ed366a481af707bd1c79.tar.xz
web: use icons for settings; misc changes
Diffstat (limited to 'web/static/sw.js')
-rw-r--r--web/static/sw.js15
1 files changed, 6 insertions, 9 deletions
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;