summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbeziapp <60441126+beziapp@users.noreply.github.com>2020-01-29 18:18:07 +0100
committerGitHub <noreply@github.com>2020-01-29 18:18:07 +0100
commit1e741671219c5cb5f13b5db9b54748739b63be61 (patch)
treee55a46eaffffba4c6e2dfa3b2f991dbaadfba5e4
parentMerge pull request #1 from beziapp/dev (diff)
parentFixed caching (diff)
downloadbeziapp-1e741671219c5cb5f13b5db9b54748739b63be61.tar
beziapp-1e741671219c5cb5f13b5db9b54748739b63be61.tar.gz
beziapp-1e741671219c5cb5f13b5db9b54748739b63be61.tar.bz2
beziapp-1e741671219c5cb5f13b5db9b54748739b63be61.tar.lz
beziapp-1e741671219c5cb5f13b5db9b54748739b63be61.tar.xz
beziapp-1e741671219c5cb5f13b5db9b54748739b63be61.tar.zst
beziapp-1e741671219c5cb5f13b5db9b54748739b63be61.zip
-rw-r--r--sw.js21
1 files changed, 7 insertions, 14 deletions
diff --git a/sw.js b/sw.js
index 156ec6e..901f721 100644
--- a/sw.js
+++ b/sw.js
@@ -73,22 +73,15 @@ importScripts("/js/lib/localforage.min.js");
self.addEventListener("install", (evt) => {
// Add localforage.clear() if storage purge is required
- evt.waitUntil(async function () {
- localforage.clear();
+ evt.waitUntil(
+ localforage.clear()
+ );
+
+ evt.waitUntil(
caches.open(static_cache_name).then((cache) => {
cache.addAll(assets);
- });
-
- if (!evt.clientId) return;
- const client = await clients.get(event.clientId);
-
- if (!client) return;
-
- client.postMessage({
- msg: "install"
- });
-
- });
+ })
+ );
});
// Delete old caches