aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.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/app.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/app.js')
-rw-r--r--src/app.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/app.js b/src/app.js
index 3f24c1c..7a931b3 100644
--- a/src/app.js
+++ b/src/app.js
@@ -83,7 +83,8 @@ function footer() {
' by ',
h('a', { href: 'https://adamsoltys.com', target: '_blank', rel: 'noopener' }, 'Adam Soltys'),
h('span', { class: 'faint' }, ' ยท '),
- h('a', { href: 'https://github.com/asoltys/cold', target: '_blank', rel: 'noopener' }, 'source available on GitHub')
+ 'source available on ',
+ h('a', { href: 'https://github.com/asoltys/cold', target: '_blank', rel: 'noopener' }, 'GitHub')
);
}
@@ -412,9 +413,15 @@ async function enterWallet(mnemonic, passphrase) {
// a brand-new wallet does one full scan.
if (hadCache || hadNostr) await wallet.refreshLive();
else await wallet.scan();
- // Align the acknowledged index after load so we only celebrate payments
- // that land while watching (not historical reconciliation).
- ui.receiveSeenIndex = wallet.nextReceiveIndex;
+ // Persisted acknowledgement: first time, baseline to the current index so we
+ // don't celebrate historical payments. After that, any advance beyond the
+ // acknowledged index shows the celebration (and survives refreshes).
+ let ack = wallet.getReceiveAck();
+ if (ack == null) {
+ ack = wallet.nextReceiveIndex;
+ wallet.setReceiveAck(ack);
+ }
+ ui.receiveSeenIndex = ack;
wallet.startRealtime();
} catch {
enterOfflineFallback();
@@ -658,7 +665,7 @@ function receiveTab() {
{
class: 'card col',
style: 'align-items:center;text-align:center;gap:14px;cursor:pointer;padding:48px 20px',
- onClick: () => { ui.receiveSeenIndex = wallet.nextReceiveIndex; render(); },
+ onClick: () => { ui.receiveSeenIndex = wallet.nextReceiveIndex; wallet.setReceiveAck(wallet.nextReceiveIndex); render(); },
},
h('div', { class: 'check-badge' }, 'โœ“'),
h('h2', { style: 'margin:0' }, 'Payment received!'),