fix: repair service-worker.js duplicate install listener causing script eval failure
Some checks failed
ERP CI/CD Pipeline / test (push) Has been cancelled
ERP CI/CD Pipeline / Deploy (server git pull + compose) (push) Has been cancelled

apply_patch previously duplicated the install event listener, causing a
ServiceWorker script evaluation error on load. Deduplicate and hoist
precacheShell() before the install listener.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
mariomitte
2026-08-10 07:53:09 +02:00
parent e3b3ff90a9
commit d2dc37aef9

View File

@@ -142,8 +142,6 @@ async function replayQueuedRequests() {
} }
} }
self.addEventListener('install', (event) => {
self.addEventListener('install', (event) => {
async function precacheShell() { async function precacheShell() {
const cache = await caches.open(CACHE_NAME); const cache = await caches.open(CACHE_NAME);
await Promise.all( await Promise.all(