new folder structure / add de translation

This commit is contained in:
nocci 2025-05-03 11:37:42 +02:00
parent 8aba6f5129
commit 4a0a5bac3f
35 changed files with 696 additions and 1124 deletions

View file

@ -0,0 +1,32 @@
const CACHE_NAME = 'game-key-manager-v2';
const ASSETS = [
'/',
'/static/style.css',
'/static/logo.webp',
'/static/logo_small.webp',
'/static/gog_logo.webp',
'/static/forgejo.webp'
];
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME)
.then(cache => cache.addAll(ASSETS))
);
});
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request)
.then(cachedResponse => cachedResponse || fetch(event.request))
);
});
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys().then(keys => Promise.all(
keys.filter(key => key !== CACHE_NAME)
.map(key => caches.delete(key))
))
);
});