fix: repair service-worker.js duplicate install listener causing script eval failure
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:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user