FIX feature to scroll down in imap folder to load more mails
This commit is contained in:
+25
-2
@@ -1,5 +1,28 @@
|
||||
const CACHE='ep-mail-v19';
|
||||
const CACHE='ep-mail-v20';
|
||||
const FILES=['./','./index.html','./styles.css','./branding.css','./renderer-state.js','./mail-content-security.js','./renderer-mail-api.js','./app.js','./platform-bridge-loader.js','./platform-bridge.js','./mail-ui.js','./productivity.js','./snooze-ui.js','./account-ui.js','./dav-ui.js','./shortcuts.js','./attachments.js','./pgp-ui.js','./pgp-mail-ui.js','./manifest.webmanifest','./icon.svg','./logo-ep-daylight.svg','./logo-ep-wasteland.svg'];
|
||||
self.addEventListener('install',event=>event.waitUntil(caches.open(CACHE).then(cache=>cache.addAll(FILES)).then(()=>self.skipWaiting())));
|
||||
self.addEventListener('activate',event=>event.waitUntil(caches.keys().then(keys=>Promise.all(keys.filter(k=>k!==CACHE).map(k=>caches.delete(k)))).then(()=>self.clients.claim())));
|
||||
self.addEventListener('fetch',event=>{if(event.request.method!=='GET')return;event.respondWith(caches.match(event.request).then(cached=>cached||fetch(event.request).then(response=>{if(new URL(event.request.url).origin===location.origin){const copy=response.clone();caches.open(CACHE).then(cache=>cache.put(event.request,copy))}return response}).catch(()=>caches.match('./index.html'))))});
|
||||
self.addEventListener('fetch', event => {
|
||||
const request = event.request;
|
||||
if (request.method !== 'GET' || new URL(request.url).origin !== location.origin) return;
|
||||
event.respondWith((async () => {
|
||||
let response;
|
||||
try {
|
||||
response = await fetch(request, { cache: 'no-cache' });
|
||||
} catch (error) {
|
||||
const cached = await caches.match(request) ||
|
||||
(request.mode === 'navigate' ? await caches.match('./index.html') : null);
|
||||
if (cached) return cached;
|
||||
throw error;
|
||||
}
|
||||
if (response.ok) {
|
||||
try {
|
||||
const cache = await caches.open(CACHE);
|
||||
await cache.put(request, response.clone());
|
||||
} catch (error) {
|
||||
console.error('Could not update offline app cache:', error);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
})());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user