aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-30 07:24:48 -0700
committerAdam Soltys <[email protected]>2026-06-30 07:24:48 -0700
commitc74a3181a415024eea016727a11a1fc59335697d (patch)
tree9451f4dd99ab2318c32969d419053ec9cbcef086
parentfeef48565032edf8d5d5e3e531db43076d08fe51 (diff)
downloadcoinosv3-c74a3181a415024eea016727a11a1fc59335697d.tar.gz
coinosv3-c74a3181a415024eea016727a11a1fc59335697d.zip
Receive: don't stack the generic celebration over the Lightning 'Received!'
A reverse-swap claim is also an on-chain receive, so after the LN 'Received!' card the generic 'Payment received' celebration would fire too — making the first Done tap appear to do nothing (it just revealed the second screen). Suppress the generic celebration while the LN claim card is shown, and have its Done ack the generic one as well, so a single tap dismisses both. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
-rw-r--r--src/app.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/app.js b/src/app.js
index 08d0cd0..f43fe1c 100644
--- a/src/app.js
+++ b/src/app.js
@@ -2602,7 +2602,11 @@ function receiveTab() {
// Until receiveSeenIndex has been baselined (post-scan, in enterWallet) it
// stays null and we never celebrate. The recency guard additionally ensures an
// already-old payment never celebrates when a wallet is opened.
- if (ui.receiveSeenIndex != null && wallet.nextReceiveIndex > ui.receiveSeenIndex && hasRecentIncoming()) {
+ // While the Lightning "Received!" card is up (a reverse-swap claim is also an
+ // on-chain receive that advances the index), suppress this generic celebration
+ // so the two don't stack — its Done dismisses both.
+ const lnClaimShown = !!(ui.lnReceiveId && (() => { const r = swaps.list().find((s) => s.id === ui.lnReceiveId); return r && ['claimed', 'success'].includes(r.status); })());
+ if (!lnClaimShown && ui.receiveSeenIndex != null && wallet.nextReceiveIndex > ui.receiveSeenIndex && hasRecentIncoming()) {
// Mark it acknowledged as soon as it's shown — so a refresh or navigating
// away (without tapping) won't bring the celebration back. It stays visible
// this session (ui.receiveSeenIndex is unchanged) until the tap below.
@@ -2672,7 +2676,7 @@ function lnReceiveContent() {
h('div', { class: 'check-badge' }, '✓'),
h('h3', { style: 'margin:0' }, t('lnReceived')),
rec.received ? h('div', { class: 'amount-pos', style: 'font-size:18px' }, '+' + fmtAmount(rec.received) + ' ' + unitLabel()) : null,
- h('button', { class: 'btn-block', onClick: () => { ui.lnReceiveId = null; ui.swapReverseAmt = ''; render(); } }, t('done')),
+ h('button', { class: 'btn-block', onClick: () => { ui.lnReceiveId = null; ui.swapReverseAmt = ''; ui.receiveSeenIndex = wallet.nextReceiveIndex; wallet.setReceiveAck(wallet.nextReceiveIndex); render(); } }, t('done')),
];
}
if (rec) {