From 8821cb2a5934f2a9ee12ae7b5c25664339421aff Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 14 Jun 2026 23:41:36 -0700 Subject: Simplify: auto-detect offline, mainnet-only, no manual refresh - Remove the unlock-screen "Offline mode" checkbox and network selector. Always mainnet. Attempt a scan on open; if navigator is offline or the scan fails (network unreachable), fall back to offline automatically with a banner + Retry instead of an upfront toggle. - Drop the manual balance "Refresh" and receive "Check for payments" buttons; the WebSocket keeps things current. - Update balances silently: add a wallet.loaded flag so the balance only dims on the very first load and history/coins only show a spinner before the first load. Background WS-driven rescans no longer flash spinners. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/wallet.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/wallet.js') diff --git a/src/wallet.js b/src/wallet.js index 21fbcf2..6395490 100644 --- a/src/wallet.js +++ b/src/wallet.js @@ -62,6 +62,7 @@ export class Wallet { this.price = null; this.scanning = false; + this.loaded = false; // true once a scan/snapshot has populated balances once this.nextReceiveIndex = 0; this.nextChangeIndex = 0; @@ -108,6 +109,7 @@ export class Wallet { this.addrMap = new Map(); this.utxos = []; this.txs = []; + this.loaded = false; this.nextReceiveIndex = 0; this.nextChangeIndex = 0; } @@ -204,6 +206,7 @@ export class Wallet { await this.refreshUtxos(); await this.refreshHistory(); + this.loaded = true; } finally { this.scanning = false; this.emit(); @@ -540,6 +543,7 @@ export class Wallet { } utxos.sort((a, b) => b.value - a.value); this.utxos = utxos; + this.loaded = true; this.emit(); return { imported: utxos.length, unmatched }; } -- cgit v1.2.3