fix: refresh installed clients and hide admin control by role
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
+5
-6
@@ -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,9 +64,10 @@ 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
|
||||||
@@ -74,8 +75,6 @@ self.addEventListener("fetch", (event) => {
|
|||||||
.then((cache) => cache.put(request, response.clone()));
|
.then((cache) => cache.put(request, response.clone()));
|
||||||
return response;
|
return response;
|
||||||
})
|
})
|
||||||
.catch(() => cached);
|
.catch(() => caches.match(request)),
|
||||||
return cached ?? update;
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user