summaryrefslogtreecommitdiff
path: root/web/static/sw.js
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-13 00:53:48 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-13 00:53:48 -0700
commite6056677192bdc6c33793e20d9b653195972694d (patch)
tree4a2a2f3436e40801df4505cc08e851cdae923706 /web/static/sw.js
parentfbfd66f18fca3a3d5cf46001eaf1661bd63bbf6d (diff)
downloaddartboat-e6056677192bdc6c33793e20d9b653195972694d.tar.gz
dartboat-e6056677192bdc6c33793e20d9b653195972694d.tar.xz
web: add better icons for PWA
Diffstat (limited to 'web/static/sw.js')
-rw-r--r--web/static/sw.js19
1 files changed, 6 insertions, 13 deletions
diff --git a/web/static/sw.js b/web/static/sw.js
index 3a92eb3..7ed7a85 100644
--- a/web/static/sw.js
+++ b/web/static/sw.js
@@ -1,23 +1,15 @@
const CACHE_PREFIX = 'dartboat-'
-const CACHE_VERSION = '1';
+const CACHE_VERSION = '2';
const CACHE_NAME = `${CACHE_PREFIX}${CACHE_VERSION}`;
const FILES = [
'./',
+ 'style.css',
'dartboat.js',
'dartboat_wasm.js',
'dartboat_wasm.wasm',
- 'style.css',
- 'icons.woff2',
- 'inter-num.woff2',
- 'dartboat_16.png',
- 'dartboat_32.png',
- 'dartboat_64.png',
- 'dartboat_96.png',
- 'dartboat_128.png',
- 'dartboat_192.png',
- 'dartboat_256.png',
- 'dartboat_512.png'
+ 'fonts/bootstrap-icons-sub.woff2',
+ 'fonts/inter-num.woff2'
]
function swlog(str) {
@@ -57,7 +49,8 @@ self.addEventListener('fetch', e => {
if (cached)
return cached;
- if (!(resp = await fetch(e.request)).ok) {
+ const resp = await fetch(e.request);
+ if (!resp.ok) {
swlog(`ignore status:${resp.status} ${e.request.url}`);
} else {
swlog(`put ${e.request.url}`);