mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-30 17:32:26 +00:00
Completes todo #15. On login, if an encrypted copy of the user's storage and/or wallet settings exists on their Nostr account — and this device hasn't already opted in — offer to restore it. - js/nostr/encryptedSync.js: exists(dTag) — cheap list-only existence peek (NO decrypt, so it doesn't spend the signer budget); decryption only on accept. - storage/walletSyncService: hasRemote() wrappers over exists(). - js/services/settingsRestorePrompt.js: one-time per-pubkey offer. Only prompts for items with a remote copy not already enabled locally; if nothing remote exists it does NOT consume the one-time offer (a note published later can still prompt next login). On accept, pulls + applies. - app.js handleLoginModalSuccess: fires maybeOfferSettingsRestore(pubkey) after login, deferred ~2s so relays connect; best-effort, never blocks login; toasts on restore. tests/settings-restore-prompt.test.mjs: offer+restore-only-remote-items, decline, prompt-once, skip-already-enabled, don't-consume-when-empty. Mutation-verified. Co-Authored-By: Claude Opus 4.8 <[email protected]>