fix(assets): handle SKIP_WAITING message in service worker

This commit is contained in:
Cell
2026-07-02 17:56:54 +08:00
parent 0f35108699
commit 9da44f0885
+7
View File
@@ -116,6 +116,13 @@ self.addEventListener('activate', (event) => {
) )
}) })
/** Allow clients to trigger immediate activation of a waiting service worker. */
self.addEventListener('message', (event) => {
if (event.data?.type === 'SKIP_WAITING') {
self.skipWaiting()
}
})
/* ========== Fetch Strategies ========== */ /* ========== Fetch Strategies ========== */
/** Route same-origin GET requests to the appropriate caching strategy. */ /** Route same-origin GET requests to the appropriate caching strategy. */