fix: refresh installed clients and hide admin control by role

This commit is contained in:
2026-07-29 23:08:32 -04:00
parent 122427d30d
commit 089ee6916f
2 changed files with 13 additions and 13 deletions
+1
View File
@@ -19,6 +19,7 @@
}
*{ box-sizing:border-box; }
.hidden{ display:none !important; }
html{ background:var(--surface); }
body{
margin:0; background:var(--surface); color:var(--ink);
+12 -13
View File
@@ -1,4 +1,4 @@
const CACHE_NAME = "roast-planner-static-v2";
const CACHE_NAME = "roast-planner-static-v3";
const APP_SHELL = [
"/",
"/landing.html",
@@ -64,18 +64,17 @@ self.addEventListener("fetch", (event) => {
return;
}
// Prefer fresh JavaScript and styles so installed clients receive UI/security updates
// immediately; use the cache only when offline.
event.respondWith(
caches.match(request).then((cached) => {
const update = fetch(request)
.then((response) => {
if (response.ok)
caches
.open(CACHE_NAME)
.then((cache) => cache.put(request, response.clone()));
return response;
})
.catch(() => cached);
return cached ?? update;
}),
fetch(request)
.then((response) => {
if (response.ok)
caches
.open(CACHE_NAME)
.then((cache) => cache.put(request, response.clone()));
return response;
})
.catch(() => caches.match(request)),
);
});