feat: complete application updates

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-09-24 22:29:28 +03:30
co-authored by Copilot
parent 981f4fdaf9
commit 148f00a75d
94 changed files with 1351 additions and 458 deletions
Vendored
+26
View File
@@ -0,0 +1,26 @@
const CACHE_NAME = 'nademitex-admin-v1'
self.addEventListener('install', () => {
self.skipWaiting()
})
self.addEventListener('activate', (event) => {
event.waitUntil(self.clients.claim())
})
self.addEventListener('fetch', (event) => {
if (event.request.method !== 'GET') return
const url = new URL(event.request.url)
if (url.origin !== self.location.origin || url.pathname.includes('/server/api')) return
event.respondWith(
fetch(event.request)
.then((response) => {
const copy = response.clone()
caches.open(CACHE_NAME).then((cache) => cache.put(event.request, copy))
return response
})
.catch(() => caches.match(event.request)),
)
})