Deploy Waters Boards to NAS / deploy (push) Canceled after 0s
Boards with groups, items, subitems and 18 column types; table, kanban, calendar, timeline, chart and files views; updates with @mentions, replies and attachments; inbox, My work, search, automations; Google sign-in restricted to company domains; live updates over SSE; a monday.com API importer; phone layout and installable PWA; Docker + Gitea Actions deploy to the NAS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
813 B
JavaScript
18 lines
813 B
JavaScript
// Network-first for the app shell so a deploy is picked up on next load; cached copy
|
|
// only when offline. API calls and files are never cached here.
|
|
const CACHE = 'wb-shell-v1';
|
|
self.addEventListener('install', (e) => self.skipWaiting());
|
|
self.addEventListener('activate', (e) => e.waitUntil(self.clients.claim()));
|
|
self.addEventListener('fetch', (e) => {
|
|
const url = new URL(e.request.url);
|
|
if (e.request.method !== 'GET' || url.origin !== location.origin) return;
|
|
if (url.pathname.startsWith('/api/') || url.pathname.startsWith('/files/')) return;
|
|
e.respondWith(
|
|
fetch(e.request).then((res) => {
|
|
const copy = res.clone();
|
|
caches.open(CACHE).then((c) => c.put(e.request, copy));
|
|
return res;
|
|
}).catch(() => caches.match(e.request).then((r) => r || caches.match('/')))
|
|
);
|
|
});
|