Changed User View and Ticket View
This commit is contained in:
1 parent
3d9f4dfda0
commit
cf8b470a20
6 files changed
+43
-17
No files matched your search
+29
-9
@@ -1,9 +1,29 @@
|
||||
// Fetches app version and updates all footer texts
|
||||
fetch('/api/version')
|
||||
.then(res => res.json())
|
||||
.then(({ version }) => {
|
||||
document.querySelectorAll('.app-footer-text').forEach(el => {
|
||||
el.textContent = `Ticket System by Honey v${version} © 2026`;
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
// Auto cache-busting: detects version changes and forces reload
|
||||
(function() {
|
||||
fetch('/api/version')
|
||||
.then(res => res.json())
|
||||
.then(({ version }) => {
|
||||
const storedVersion = localStorage.getItem('app_version');
|
||||
|
||||
// Version changed → force hard reload
|
||||
if (storedVersion && storedVersion !== version) {
|
||||
localStorage.setItem('app_version', version);
|
||||
// Clear caches if available
|
||||
if ('caches' in window) {
|
||||
caches.keys().then(names => names.forEach(name => caches.delete(name)));
|
||||
}
|
||||
window.location.reload(true);
|
||||
return;
|
||||
}
|
||||
|
||||
// Store current version
|
||||
localStorage.setItem('app_version', version);
|
||||
|
||||
// Update footer
|
||||
const year = new Date().getFullYear();
|
||||
document.querySelectorAll('.app-footer-text').forEach(el => {
|
||||
el.textContent = `Ticket System by Honey v${version} © ${year}`;
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
})();
|
||||
Reference in new issue
Block a user