diff options
author | altaf-creator <64111012+altaf-creator@users.noreply.github.com> | 2023-05-04 21:10:33 +0700 |
---|---|---|
committer | altaf-creator <64111012+altaf-creator@users.noreply.github.com> | 2023-05-04 21:10:33 +0700 |
commit | f45d7e0c18fb2254a1362e1b9d34047d50251765 (patch) | |
tree | 269b906129a4bdbdc5717ddbb8587da1ef7bd665 /src | |
parent | 85ee5701f80c265f069845b840f368bacf6fc5a6 (diff) |
PWA Update - attempt 5.1
Diffstat (limited to 'src')
-rw-r--r-- | src/scripts/service-worker.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/scripts/service-worker.js b/src/scripts/service-worker.js index e6d2a5a..2911784 100644 --- a/src/scripts/service-worker.js +++ b/src/scripts/service-worker.js @@ -26,7 +26,10 @@ const assets = [ self.addEventListener("install", installEvent => { installEvent.waitUntil( caches.open(staticQuran).then(cache => { - cache.addAll(assets) + for (var i = 0; i < assets.length; i++) + { + cache.add(assets[i]); + } }) ) }) @@ -34,7 +37,7 @@ self.addEventListener("install", installEvent => { self.addEventListener("fetch", fetchEvent => { fetchEvent.respondWith( caches.match(fetchEvent.request).then(res => { - return res || fetch(fetchEvent.request) + return res || fetch(fetchEvent.request); }) ) })
\ No newline at end of file |