summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsijanec <sijanecantonluka@gmail.com>2020-08-31 00:12:23 +0200
committersijanec <sijanecantonluka@gmail.com>2020-08-31 00:12:23 +0200
commit7225230e2dd7f92e8ef4106f35ecfdd0ccaf496f (patch)
treec9f1364b98b4804ebeba7d41ae0e86d741f43de9
parentsw (diff)
downloadttx-app-7225230e2dd7f92e8ef4106f35ecfdd0ccaf496f.tar
ttx-app-7225230e2dd7f92e8ef4106f35ecfdd0ccaf496f.tar.gz
ttx-app-7225230e2dd7f92e8ef4106f35ecfdd0ccaf496f.tar.bz2
ttx-app-7225230e2dd7f92e8ef4106f35ecfdd0ccaf496f.tar.lz
ttx-app-7225230e2dd7f92e8ef4106f35ecfdd0ccaf496f.tar.xz
ttx-app-7225230e2dd7f92e8ef4106f35ecfdd0ccaf496f.tar.zst
ttx-app-7225230e2dd7f92e8ef4106f35ecfdd0ccaf496f.zip
-rw-r--r--sw.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/sw.js b/sw.js
index 3f03425..58317c0 100644
--- a/sw.js
+++ b/sw.js
@@ -43,7 +43,7 @@ self.addEventListener("activate", evt => {
);
});
-self.addEventListener("fetch", (evt) => {
+self.addEventListener("fetch", (event) => {
if (event.request.mode === 'navigate' || // tole ni povsod podprto, zato
( (event.request.method === 'GET' || // če je GET
event.request.method === 'POST') // ali POST zahteva
@@ -53,8 +53,8 @@ self.addEventListener("fetch", (evt) => {
return cacches.match(offlineUrl);
}));
} else { // zahteva je za nek resource (css/js/img), ne za stran
- evt.respondWith(caches.match(evt.request).then((cache_res) => {
- return cache_res || fetch(evt.request);
+ event.respondWith(caches.match(event.request).then((cache_res) => {
+ return cache_res || fetch(event.request);
}))
}
});