feat: add module generator feature with controller, routing, and UI integration
This commit is contained in:
+13
-3
@@ -1,11 +1,21 @@
|
||||
self.addEventListener('install', (event) => {
|
||||
event.waitUntil(
|
||||
caches.open('app-cache').then((cache) => {
|
||||
return cache.addAll([
|
||||
'/',
|
||||
// Use a more robust approach: attempt to cache but don't fail the whole installation if one fails
|
||||
const urlsToCache = [
|
||||
'/assets/manifest.json',
|
||||
'/assets/favicon.png'
|
||||
]);
|
||||
];
|
||||
|
||||
return Promise.all(
|
||||
urlsToCache.map(url => {
|
||||
return fetch(url).then(response => {
|
||||
if (response.ok) {
|
||||
return cache.put(url, response);
|
||||
}
|
||||
}).catch(err => console.warn('SW: Failed to cache ' + url, err));
|
||||
})
|
||||
);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user