feat: PWA update strategy with hashed assets and cache control
Move frontend sources to frontend/, build content-hashed assets at deploy, network-first SW for shell/JS, immutable cache for /assets/, version.json update banner, and Cache-Control middleware. Docs in docs/PWA-STRATEGY.md. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
export async function setStreakBadge(streak) {
|
||||
if (!("setAppBadge" in navigator)) return;
|
||||
try {
|
||||
if (streak > 0) await navigator.setAppBadge(streak);
|
||||
else await navigator.clearAppBadge();
|
||||
} catch { /* unsupported */ }
|
||||
}
|
||||
|
||||
export async function clearBadge() {
|
||||
if (!("clearAppBadge" in navigator)) return;
|
||||
try { await navigator.clearAppBadge(); } catch { /* noop */ }
|
||||
}
|
||||
Reference in New Issue
Block a user