fix: clear Service Worker caches correctly

This commit is contained in:
fly_mc 2024-11-13 19:21:09 +08:00
parent c8a769e753
commit bb2c6e0326

View file

@ -36,7 +36,7 @@ globalThis.addEventListener('activate', ev => {
caches.keys()
.then(cacheNames => Promise.all(
cacheNames
.filter((v) => v !== swLang.cacheName && !v.startsWith('misskey-static-'))
.filter((v) => v !== STATIC_CACHE_NAME && v !== swLang.cacheName)
.map(name => caches.delete(name)),
))
.then(() => globalThis.clients.claim()),