aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-27 14:14:03 -0700
committerAdam Soltys <[email protected]>2026-06-27 14:14:03 -0700
commit342987a97dfa031e43e370b593bc9b57012dcc71 (patch)
tree55261945fe776048d45d375c42dcccf531e4da47
parent000d7894074d8d1fe85cd4f98d3470aa685a727f (diff)
downloadcoinosv3-342987a97dfa031e43e370b593bc9b57012dcc71.tar.gz
coinosv3-342987a97dfa031e43e370b593bc9b57012dcc71.zip
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 <[email protected]>
-rw-r--r--src/app.js7
1 files changed, 6 insertions, 1 deletions
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.