mirror of
https://github.com/woodchen-ink/watermark.git
synced 2025-07-18 14:02:01 +08:00
update
This commit is contained in:
parent
68463aeaf0
commit
0d82f826be
@ -20,3 +20,20 @@ self.addEventListener("fetch", event => {
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
self.addEventListener('activate', function(e) {
|
||||
e.waitUntil(
|
||||
Promise.all(
|
||||
caches.keys().then(cacheNames => {
|
||||
return cacheNames.map(name => {
|
||||
if (name !== cacheStorageKey) {
|
||||
return caches.delete(name)
|
||||
}
|
||||
})
|
||||
})
|
||||
).then(() => {
|
||||
return self.clients.claim()
|
||||
})
|
||||
)
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user