diff options
| author | Adam Soltys <[email protected]> | 2026-06-30 07:24:48 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-30 07:24:48 -0700 |
| commit | c74a3181a415024eea016727a11a1fc59335697d (patch) | |
| tree | 9451f4dd99ab2318c32969d419053ec9cbcef086 /src | |
| parent | feef48565032edf8d5d5e3e531db43076d08fe51 (diff) | |
| download | coinosv3-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]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/app.js | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) { |
