mirror of
https://github.com/sassanix/Warracker.git
synced 2026-05-04 23:39:11 -05:00
e4a24482f7
This release introduces several key features and improvements
Added:
- Account email change support from Settings with full validation and UI update.
- Progressive Web App (PWA) capability with manifest and service worker integration.
- "Manage Tags" button on the main page to streamline tag management UX.
Changed:
- Improved responsiveness of key pages (index, status) across mobile and tablet views.
- Replaced hardcoded DB credentials with environment variable references (contribution by @humrochagf, commit 20997e9):
• Credentials are now pulled from Docker Compose env vars.
• Redundant superuser credential checks removed.
• Updated migration and permission scripts for dynamic configuration.
This version enhances user flexibility, security, and cross-device compatibility.
51 lines
1.1 KiB
JavaScript
51 lines
1.1 KiB
JavaScript
const CACHE_NAME = 'warracker-cache-v1';
|
|
const urlsToCache = [
|
|
'./',
|
|
'./index.html',
|
|
'./style.css',
|
|
'./script.js',
|
|
'./manifest.json',
|
|
'./img/favicon-16x16.png',
|
|
'./img/favicon-32x32.png',
|
|
'./img/favicon-512x512.png'
|
|
// Add other important assets here, especially icons declared in manifest.json
|
|
];
|
|
|
|
self.addEventListener('install', event => {
|
|
event.waitUntil(
|
|
caches.open(CACHE_NAME)
|
|
.then(cache => {
|
|
console.log('Opened cache');
|
|
return cache.addAll(urlsToCache);
|
|
})
|
|
);
|
|
});
|
|
|
|
self.addEventListener('fetch', event => {
|
|
event.respondWith(
|
|
caches.match(event.request)
|
|
.then(response => {
|
|
// Cache hit - return response
|
|
if (response) {
|
|
return response;
|
|
}
|
|
return fetch(event.request);
|
|
}
|
|
)
|
|
);
|
|
});
|
|
|
|
self.addEventListener('activate', event => {
|
|
const cacheWhitelist = [CACHE_NAME];
|
|
event.waitUntil(
|
|
caches.keys().then(cacheNames => {
|
|
return Promise.all(
|
|
cacheNames.map(cacheName => {
|
|
if (cacheWhitelist.indexOf(cacheName) === -1) {
|
|
return caches.delete(cacheName);
|
|
}
|
|
})
|
|
);
|
|
})
|
|
);
|
|
});
|