fix: refresh installed clients and hide admin control by role
This commit is contained in:
@@ -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
@@ -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)),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user