mirror of
http://nostr-git-proxy.forgejo.svc.cluster.local/git/45387ca441053e230b2126802005eb03767ab59d84555e8bac86b6e7def14e27/myadhd
synced 2026-09-23 20:23:10 +00:00
BUG 2 — Timer not reset after mark-done: extract timerReset() and call it after marking a step done so the timer is ready for the next step BUG 4 — ARIA tabpanel linking: add id/aria-controls on tabs, aria-labelledby on panels BUG 6 — SW missing icons: add icon-192.png and icon-512.png to cache list, bump cache version to v2 BUG 7 — og:url: add missing meta tag
32 lines
842 B
JavaScript
32 lines
842 B
JavaScript
/* myadhd.dev — service worker for offline PWA */
|
|
var CACHE = 'myadhd-v2';
|
|
var ASSETS = [
|
|
'/',
|
|
'/index.html',
|
|
'/static/style.css',
|
|
'/static/app.js',
|
|
'/static/favicon.svg',
|
|
'/static/icon-192.png',
|
|
'/static/icon-512.png',
|
|
'/manifest.json'
|
|
];
|
|
|
|
self.addEventListener('install', function (e) {
|
|
e.waitUntil(caches.open(CACHE).then(function (c) { return c.addAll(ASSETS); }));
|
|
self.skipWaiting();
|
|
});
|
|
|
|
self.addEventListener('activate', function (e) {
|
|
e.waitUntil(
|
|
caches.keys().then(function (names) {
|
|
return Promise.all(names.filter(function (n) { return n !== CACHE; }).map(function (n) { return caches.delete(n); }));
|
|
})
|
|
);
|
|
self.clients.claim();
|
|
});
|
|
|
|
self.addEventListener('fetch', function (e) {
|
|
e.respondWith(
|
|
caches.match(e.request).then(function (r) { return r || fetch(e.request); })
|
|
);
|
|
});
|