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; } *{ box-sizing:border-box; }
.hidden{ display:none !important; }
html{ background:var(--surface); } html{ background:var(--surface); }
body{ body{
margin:0; background:var(--surface); color:var(--ink); 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 = [ const APP_SHELL = [
"/", "/",
"/landing.html", "/landing.html",
@@ -64,18 +64,17 @@ self.addEventListener("fetch", (event) => {
return; return;
} }
// Prefer fresh JavaScript and styles so installed clients receive UI/security updates
// immediately; use the cache only when offline.
event.respondWith( event.respondWith(
caches.match(request).then((cached) => { fetch(request)
const update = fetch(request) .then((response) => {
.then((response) => { if (response.ok)
if (response.ok) caches
caches .open(CACHE_NAME)
.open(CACHE_NAME) .then((cache) => cache.put(request, response.clone()));
.then((cache) => cache.put(request, response.clone())); return response;
return response; })
}) .catch(() => caches.match(request)),
.catch(() => cached);
return cached ?? update;
}),
); );
}); });