match fedibird's SW
This commit is contained in:
parent
2358754bb3
commit
702f82cb04
1 changed files with 2 additions and 13 deletions
|
@ -68,19 +68,8 @@ self.addEventListener('activate', function(event) {
|
|||
self.addEventListener('fetch', function(event) {
|
||||
const url = new URL(event.request.url);
|
||||
|
||||
const asyncResponse = fetch(event.request);
|
||||
const asyncCache = openWebCache();
|
||||
|
||||
event.respondWith(asyncResponse.then(response => {
|
||||
if (response.ok || response.type === 'opaqueredirect') {
|
||||
return Promise.all([
|
||||
asyncCache.then(cache => cache.delete('/web')),
|
||||
indexedDB.deleteDatabase('mastodon'),
|
||||
]).then(() => response);
|
||||
}
|
||||
|
||||
return response;
|
||||
}));
|
||||
if (url.pathname.startsWith('/web')) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue