This commit is contained in:
Renan LE CARO 2025-03-19 14:31:14 +01:00
parent 2fdb74a433
commit 1c4f3d1451
9 changed files with 13 additions and 14 deletions

View file

@ -1,5 +1,5 @@
// The version of the cache.
const VERSION = "29039830";
const VERSION = "29039851";
// The name of the cache
const CACHE_NAME = `breakout-71-${VERSION}`;
@ -12,7 +12,7 @@ self.addEventListener("install", (event) => {
event.waitUntil(
(async () => {
const cache = await caches.open(CACHE_NAME);
cache.addAll(APP_STATIC_RESOURCES);
await cache.addAll(APP_STATIC_RESOURCES);
})(),
);
});

View file

@ -1,7 +1,9 @@
import version from "../data/version.json";
if (
"serviceWorker" in navigator
// && window.location.search.includes("isPWA=true")
"serviceWorker" in navigator &&
window.location.href.endsWith("/index.html?isPWA=true")
) {
// @ts-ignore
navigator.serviceWorker.register(new URL("sw-b71.js", import.meta.url));
const url = new URL("sw-b71.js", import.meta.url);
navigator.serviceWorker.register(url);
}

View file

@ -1 +1 @@
"29039830"
"29039851"