From 342987a97dfa031e43e370b593bc9b57012dcc71 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 27 Jun 2026 14:14:03 -0700 Subject: Don't flash 'Payment received' on import for a pre-existing deposit On a fresh open, receiveSeenIndex was baselined to the pre-scan frontier (line 691), so the moment the socket's reconcile credited a deposit that predated the open, nextReceiveIndex advanced past it and the celebration flashed for ~2s until the post-scan baseline caught up. Leave receiveSeenIndex null until that final baseline for fresh opens (matching the documented intent); the != null guard then suppresses the flash. Same-session refreshes still use the persisted ack. Co-Authored-By: Claude Opus 4.8 --- src/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app.js b/src/app.js index 6eb1498..caddeb5 100644 --- a/src/app.js +++ b/src/app.js @@ -688,7 +688,12 @@ async function activateAccount(acc, opts = {}) { wallet.setReceiveAck(ack); } } - ui.receiveSeenIndex = ack; + // For a fresh open, leave receiveSeenIndex null until the post-scan baseline + // below. Setting it now (to the pre-scan frontier) lets the socket's reconcile + // credit a deposit that predates this open and briefly flash the "payment + // received" screen before the baseline catches up. A same-session refresh + // uses the persisted ack right away. + if (!opts.fresh) ui.receiveSeenIndex = ack; // Go Live immediately: the socket must not wait on Nostr (up to 6s) or any // discovery scan. The cache/Nostr state is already on screen. -- cgit v1.2.3