v0.2.2.2 (#830)
This commit is contained in:
MartinNYHC
2026-03-27 09:27:47 +01:00
committed by GitHub
parent 8270030687
commit 67f91d94de
112 changed files with 18595 additions and 9993 deletions
+22 -10
View File
@@ -28,18 +28,30 @@
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<!-- Service Worker Registration -->
<!-- Service Worker Registration (skip on SpoolBuddy kiosk) -->
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js')
.then((registration) => {
console.log('SW registered:', registration.scope);
})
.catch((error) => {
console.log('SW registration failed:', error);
});
});
if (location.pathname.startsWith('/spoolbuddy')) {
// Kiosk mode — nuke SW and all caches, then reload once to get clean state
navigator.serviceWorker.getRegistrations().then((regs) => {
if (regs.length > 0) {
Promise.all([
...regs.map((r) => r.unregister()),
caches.keys().then((names) => Promise.all(names.map((n) => caches.delete(n)))),
]).then(() => location.reload());
}
});
} else {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js')
.then((registration) => {
console.log('SW registered:', registration.scope);
})
.catch((error) => {
console.log('SW registration failed:', error);
});
});
}
}
</script>
</body>