Skip to content

Commit

Permalink
fixed strings
Browse files Browse the repository at this point in the history
  • Loading branch information
shroomlife committed Nov 8, 2023
1 parent 00d3806 commit 035d644
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions static/worker.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
const CACHE_NAME = "shroomlife-1.3.0";
const CACHE_NAME = 'shroomlife-1.3.0'

self.addEventListener("install", (event) => {
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME).then((cache) => {
const urlsToCache = ["/favicon.ico"];
return cache.addAll(urlsToCache);
const urlsToCache = ['/favicon.ico']
return cache.addAll(urlsToCache)
})
);
});
)
})

self.addEventListener("activate", (event) => {
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys().then((cacheNames) => {
return Promise.all(
cacheNames.map((cacheName) => {
if (cacheName !== CACHE_NAME) {
return caches.delete(cacheName);
return caches.delete(cacheName)
}
})
);
)
})
);
});
)
})

self.addEventListener("fetch", (event) => {
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request).then((response) => {
if (response) {
return response;
return response
}

var fetchRequest = event.request.clone();
const fetchRequest = event.request.clone()

return fetch(fetchRequest).then((response) => {
if (!response || response.status !== 200 || response.type !== "basic") {
return response;
if (!response || response.status !== 200 || response.type !== 'basic') {
return response
}

var responseToCache = response.clone();
const responseToCache = response.clone()

caches.open(CACHE_NAME).then((cache) => {
cache.put(event.request, responseToCache);
});
cache.put(event.request, responseToCache)
})

return response;
});
return response
})
})
);
});
)
})

0 comments on commit 035d644

Please sign in to comment.