aboutsummaryrefslogtreecommitdiffstats
path: root/src/wallet.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-16 00:20:52 -0700
committerAdam Soltys <[email protected]>2026-06-16 00:20:52 -0700
commitfc054510669f1e1017f985df11f603f0efe47b9b (patch)
tree854850d7c57016c2a993c3348657f0bc211fa9b3 /src/wallet.js
parentdb438d1d6feb6edccf782e0e22793cf8e4602cb1 (diff)
downloadcoinosv3-fc054510669f1e1017f985df11f603f0efe47b9b.tar.gz
coinosv3-fc054510669f1e1017f985df11f603f0efe47b9b.zip
Persist payment-received ack across reloads; footer + README
- The "Payment received!" celebration now persists: the acknowledged fresh index is stored (per seed) in localStorage, so a received payment keeps showing the dialog until you tap past it, even after a refresh. - Footer: only "GitHub" is the link now. - README rewritten for the current state (mainnet-only, realtime, Nostr sync, multi-recipient, sats default, explorer resilience, etc.). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'src/wallet.js')
-rw-r--r--src/wallet.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/wallet.js b/src/wallet.js
index c57149f..f47d2f1 100644
--- a/src/wallet.js
+++ b/src/wallet.js
@@ -767,6 +767,24 @@ export class Wallet {
return 'btc-wallet-cache:' + hex.encode(sha256(bytes)).slice(0, 32);
}
+ // The fresh receive index the user has acknowledged (tapped past the
+ // "payment received" screen for). Persisted so a received payment keeps
+ // showing the celebration until acknowledged, even across refreshes.
+ getReceiveAck() {
+ try {
+ const v = localStorage.getItem(this._cacheKey() + ':ack');
+ return v == null ? null : Number(v);
+ } catch {
+ return null;
+ }
+ }
+
+ setReceiveAck(i) {
+ try {
+ localStorage.setItem(this._cacheKey() + ':ack', String(i));
+ } catch {}
+ }
+
// The serializable wallet state, shared by the localStorage cache and the
// Nostr sync. savedAt lets us pick the newest copy across devices.
_snapshot() {