From d071a09604599831d370b06563144cf4ba028902 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 6 Jul 2026 11:12:31 -0700 Subject: Gift cross-device sync, snapshot size cap, reliable SW updates, gift-detail layout - Gifts now sync across devices: gift records + reserved/reclaimed coin sets ride the encrypted snapshot as a merge-safe extension (like ark), and every gift state change (create/reclaim/revoke) triggers a saveCache so it actually publishes. A gift made on one device now shows on the others. - Cap the published snapshot at ~40KB JSON (relay rejects >64KB events, nip44 expands ~1.5x): trim oldest on-chain txs when oversized; another device backfills via rescan. Typical wallets untouched. - Service worker: register with updateViaCache:'none' so a new build is detected immediately (not held by the 4h HTTP cache), and reload once on controllerchange so the fresh app runs without a manual second refresh. - Gift detail: View/Reclaim share a row, Revoke on its own full-width line so 'Revoke now' stops wrapping. Co-Authored-By: Claude Fable 5 --- build.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'build.js') diff --git a/build.js b/build.js index 5165669..58ca0ba 100644 --- a/build.js +++ b/build.js @@ -104,8 +104,15 @@ const PWA_HEAD = ` `; +// Register with updateViaCache:'none' so the browser always re-fetches sw.js +// (never from HTTP cache) and detects a new build immediately. When the new SW +// takes control (it skipWaiting + clients.claim), reload once so the fresh +// inlined app runs — but only if a SW was already controlling this page, so a +// first-ever visit doesn't reload. const SW_REGISTER = - ``; + ``; // Bundle the standalone jsQR decoder (sets window.jsQR) for lazy loading. export async function buildJsQr({ minify = true } = {}) { -- cgit v1.2.3