Add multi account support and fixed functionality of buttons calendar etc

This commit is contained in:
2026-10-04 23:42:17 +03:00
parent 12e40aac6d
commit 12730e4f7e
12 changed files with 1181 additions and 19 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
const CACHE='daybreak-mail-v1';
const FILES=['./','./index.html','./styles.css','./app.js','./manifest.webmanifest','./icon.svg'];
const CACHE='daybreak-mail-v3';
const FILES=['./','./index.html','./styles.css','./app.js','./mail-ui.js','./productivity.js','./account-ui.js','./manifest.webmanifest','./icon.svg'];
self.addEventListener('install',event=>event.waitUntil(caches.open(CACHE).then(cache=>cache.addAll(FILES))));
self.addEventListener('activate',event=>event.waitUntil(caches.keys().then(keys=>Promise.all(keys.filter(k=>k!==CACHE).map(k=>caches.delete(k))))));
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'))))});