From f45d7e0c18fb2254a1362e1b9d34047d50251765 Mon Sep 17 00:00:00 2001 From: altaf-creator <64111012+altaf-creator@users.noreply.github.com> Date: Thu, 4 May 2023 21:10:33 +0700 Subject: PWA Update - attempt 5.1 --- src/scripts/service-worker.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/scripts') 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 -- cgit v1.2.3