diff options
author | rstular <rok@stular.eu> | 2020-01-29 18:17:21 +0100 |
---|---|---|
committer | rstular <rok@stular.eu> | 2020-01-29 18:17:21 +0100 |
commit | 5fec6522de552dfdf7eb15ced35a9df770c362e5 (patch) | |
tree | e55a46eaffffba4c6e2dfa3b2f991dbaadfba5e4 | |
parent | Version fix (diff) | |
download | beziapp-5fec6522de552dfdf7eb15ced35a9df770c362e5.tar beziapp-5fec6522de552dfdf7eb15ced35a9df770c362e5.tar.gz beziapp-5fec6522de552dfdf7eb15ced35a9df770c362e5.tar.bz2 beziapp-5fec6522de552dfdf7eb15ced35a9df770c362e5.tar.lz beziapp-5fec6522de552dfdf7eb15ced35a9df770c362e5.tar.xz beziapp-5fec6522de552dfdf7eb15ced35a9df770c362e5.tar.zst beziapp-5fec6522de552dfdf7eb15ced35a9df770c362e5.zip |
-rw-r--r-- | sw.js | 21 |
1 files changed, 7 insertions, 14 deletions
@@ -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 |