mirror of
https://github.com/paricafe/misskey.git
synced 2025-02-17 13:37:29 -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 => {
|
globalThis.addEventListener('fetch', ev => {
|
||||||
const shouldCache = PATHS_TO_CACHE.some(path => ev.request.url.includes(path));
|
const shouldCache = PATHS_TO_CACHE.some(path => ev.request.url.includes(path));
|
||||||
|
|
||||||
if (shouldCache) {
|
if (shouldCache) {
|
||||||
ev.respondWith(
|
ev.respondWith(
|
||||||
caches.match(ev.request)
|
caches.match(ev.request)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response) return response;
|
if (response) return response;
|
||||||
|
|
||||||
return fetch(ev.request).then(response => {
|
return fetch(ev.request).then(response => {
|
||||||
if (!response || response.status !== 200 || response.type !== 'basic') return response;
|
if (!response || response.status !== 200 || response.type !== 'basic') return response;
|
||||||
const responseToCache = response.clone();
|
const responseToCache = response.clone();
|
||||||
|
@ -251,4 +251,4 @@ globalThis.addEventListener('message', (ev: ServiceWorkerGlobalScopeEventMap['me
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})());
|
})());
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue