Lägger till iconer samt flyttar runt filer för att få till PWA. Still not working

This commit is contained in:
2025-01-24 17:37:42 +01:00
parent d14d65f3eb
commit 575384d67f
2 changed files with 0 additions and 0 deletions

23
public/service-worker.js Normal file
View File

@@ -0,0 +1,23 @@
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open('task-manager-cache').then((cache) => {
return cache.addAll([
'/',
'/index.html',
'/style.css',
'/app.js',
'/manifest.json',
'/icons/icon-192x192.png',
'/icons/icon-512x512.png'
]);
})
);
});
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request).then((cachedResponse) => {
return cachedResponse || fetch(event.request);
})
);
});