aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-22 21:47:09 -0700
committerAdam Soltys <[email protected]>2026-06-22 21:47:09 -0700
commit7c542410dc78711bcf017dd3d23d560ed6349669 (patch)
tree79e3f911264d76851064b4da2c81e5c8f9a827db /src
parent44231703087408884ad3ed31c313fc306d4e90c8 (diff)
downloadcoinosv3-7c542410dc78711bcf017dd3d23d560ed6349669.tar.gz
coinosv3-7c542410dc78711bcf017dd3d23d560ed6349669.zip
Fix false "payment received" on import; PWA; send-page font
- Don't celebrate historical payments on import. receiveSeenIndex was baselined to 0 before the scan ran, so when the scan advanced the index every past payment looked new and flashed "payment received". Leave it null until the post-scan ack logic baselines it. - PWA: add a web manifest, ₿ icons (192/512 + maskable), theme/apple meta tags, and a service worker that precaches the shell so the installed app works offline. index.html stays self-contained; the sidecar files just 404 harmlessly from file://. build.js emits them. - Send page: drop btn-sm from the amount unit toggle so "sats" matches the "Max" button size (both 16px). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/app.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/app.js b/src/app.js
index bccb86d..8343290 100644
--- a/src/app.js
+++ b/src/app.js
@@ -466,6 +466,10 @@ async function enterWallet(mnemonic, passphrase) {
const hadCache = wallet.restoreCache(); // show last-known balance/history instantly
ui.screen = 'wallet';
ui.tab = 'receive';
+ // Not baselined yet — stays null until the scan + ack logic below sets it,
+ // so the celebration never fires for payments that were already there at
+ // import (the index only looks "advanced" because the scan hadn't run yet).
+ ui.receiveSeenIndex = null;
ui.send = blankSend();
ui.draft = null;
ui.sendResult = null;
@@ -760,11 +764,12 @@ function tabContent() {
// ---------------------------------------------------------------- Receive
function receiveTab() {
- if (ui.receiveSeenIndex == null) ui.receiveSeenIndex = wallet.nextReceiveIndex;
-
// A payment landed on the shown address (the fresh index advanced past what
// the user last saw) — celebrate, and wait for a tap before showing the next.
- if (wallet.nextReceiveIndex > ui.receiveSeenIndex) {
+ // Until receiveSeenIndex has been baselined (post-scan, in enterWallet) it
+ // stays null and we never celebrate, so importing a wallet with existing
+ // history doesn't flash "payment received" for old payments.
+ if (ui.receiveSeenIndex != null && wallet.nextReceiveIndex > ui.receiveSeenIndex) {
let amt = 0;
for (let i = ui.receiveSeenIndex; i < wallet.nextReceiveIndex; i++) {
const e = wallet._addrInfo(0, i);
@@ -837,7 +842,7 @@ function recipientRow(s, r, i) {
r.amount = v;
},
}),
- h('button', { type: 'button', class: 'btn-sm', title: t('switchUnit'), onClick: toggleUnit }, unitLabel()),
+ h('button', { type: 'button', title: t('switchUnit'), onClick: toggleUnit }, unitLabel()),
single && h('button', { type: 'button', class: s.max ? 'btn-primary' : '', onClick: () => { s.max = !s.max; render(); } }, t('max'))
)
);