feat: add PWA offline unlock support

This commit is contained in:
shuaiplus
2026-06-09 12:09:44 +08:00
parent 5ed7c949c1
commit d4749d3f82
10 changed files with 527 additions and 10 deletions
+11
View File
@@ -0,0 +1,11 @@
export function registerNodeWardenServiceWorker(): void {
if (typeof window === 'undefined') return;
if (!('serviceWorker' in navigator)) return;
if (import.meta.env.DEV) return;
window.addEventListener('load', () => {
void navigator.serviceWorker.register('/sw.js', { scope: '/' }).catch(() => {
// PWA support is progressive enhancement; the vault still works without it.
});
});
}