restore modal animation on desktop

This commit is contained in:
marlon-erler
2026-04-01 08:46:10 +00:00
parent fd8aafed6d
commit 551d2c3aba
7 changed files with 9267 additions and 7190 deletions
Vendored
+19 -18
View File
@@ -1,31 +1,32 @@
const CACHE_VERSION = "v2";
self.addEventListener("fetch", (event) => {
event.respondWith(handleRequest(event));
event.respondWith(handleRequest(event));
});
async function handleRequest(event) {
const response = await getFromCache(event);
if (response) {
fetchAndCache(event); // Call this but don't await, allowing the cache to update in the background
return response;
}
return fetchAndCache(event);
const response = await getFromCache(event);
if (response) {
fetchAndCache(event); // Call this but don't await, allowing the cache to update in the background
return response;
}
return fetchAndCache(event);
}
async function getFromCache(event) {
const request = event.request;
const cache = await caches.open(CACHE_VERSION);
const response = await cache.match(request);
return response;
const request = event.request;
const cache = await caches.open(CACHE_VERSION);
const response = await cache.match(request);
return response;
}
async function fetchAndCache(event) {
const request = event.request;
const response = await fetch(request);
if (response.status === 200) { // Only cache successful responses
const cache = await caches.open(CACHE_VERSION);
cache.put(request, response.clone());
}
return response;
const request = event.request;
const response = await fetch(request);
if (response.status === 200) {
// Only cache successful responses
const cache = await caches.open(CACHE_VERSION);
cache.put(request, response.clone());
}
return response;
}