feat: Add PWA support (manifest, service worker) and Companies tab to project edit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
const CACHE_NAME = 'construprogress-cache-v1';
|
||||
const urlsToCache = [
|
||||
'/',
|
||||
'/dashboard',
|
||||
'/projects',
|
||||
'/projects-list',
|
||||
'/projects/templates',
|
||||
'/css/app.css',
|
||||
'/js/app.js',
|
||||
// Add other assets as needed
|
||||
];
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
event.waitUntil(
|
||||
caches.open(CACHE_NAME)
|
||||
.then((cache) => cache.addAll(urlsToCache))
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', (event) => {
|
||||
event.respondWith(
|
||||
caches.match(event.request)
|
||||
.then((response) => {
|
||||
if (response) {
|
||||
return response;
|
||||
}
|
||||
return fetch(event.request);
|
||||
})
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user