Atualização automática - 2026-06-24 10:09:20

This commit is contained in:
2026-06-24 10:09:20 +00:00
parent 7faf42f96b
commit 9b13e3545c
2 changed files with 17 additions and 40 deletions
+1 -13
View File
@@ -6,17 +6,5 @@
"display": "standalone", "display": "standalone",
"background_color": "#0f172a", "background_color": "#0f172a",
"theme_color": "#1e40af", "theme_color": "#1e40af",
"orientation": "portrait-primary", "orientation": "portrait-primary"
"icons": [
{
"src": "/icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
} }
+16 -27
View File
@@ -1,35 +1,24 @@
const CACHE_NAME = 'steelcheck-v1'; const CACHE_NAME = 'steelcheck-v2';
const ASSETS = [
'/',
'/index.html',
'/index.tsx',
'/style.css'
];
self.addEventListener('install', (event) => { self.addEventListener('install', (e) => {
event.waitUntil( self.skipWaiting();
caches.open(CACHE_NAME).then((cache) => {
return cache.addAll(ASSETS);
})
);
}); });
self.addEventListener('fetch', (event) => { self.addEventListener('activate', (e) => {
event.respondWith( e.waitUntil(
caches.match(event.request).then((response) => {
return response || fetch(event.request);
})
);
});
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys().then((cacheNames) => { caches.keys().then((cacheNames) => {
return Promise.all( return Promise.all(
cacheNames cacheNames.map((cacheName) => {
.filter((name) => name !== CACHE_NAME) return caches.delete(cacheName);
.map((name) => caches.delete(name)) })
); );
}).then(() => {
return self.clients.claim();
}) })
); );
}); });
self.addEventListener('fetch', (e) => {
// Always fetch from network to avoid caching old index.html
e.respondWith(fetch(e.request));
});