mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-24 07:06:44 -06:00
lint
This commit is contained in:
parent
6dcd38e746
commit
afec66841d
1 changed files with 3 additions and 3 deletions
|
@ -56,13 +56,13 @@ async function offlineContentHTML() {
|
|||
|
||||
globalThis.addEventListener('fetch', ev => {
|
||||
const shouldCache = PATHS_TO_CACHE.some(path => ev.request.url.includes(path));
|
||||
|
||||
|
||||
if (shouldCache) {
|
||||
ev.respondWith(
|
||||
caches.match(ev.request)
|
||||
.then(response => {
|
||||
if (response) return response;
|
||||
|
||||
|
||||
return fetch(ev.request).then(response => {
|
||||
if (!response || response.status !== 200 || response.type !== 'basic') return response;
|
||||
const responseToCache = response.clone();
|
||||
|
@ -251,4 +251,4 @@ globalThis.addEventListener('message', (ev: ServiceWorkerGlobalScopeEventMap['me
|
|||
}
|
||||
}
|
||||
})());
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue