diff options
| author | Adam Soltys <[email protected]> | 2026-06-14 23:41:36 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-14 23:41:36 -0700 |
| commit | 8821cb2a5934f2a9ee12ae7b5c25664339421aff (patch) | |
| tree | 36c605298de7b5e42cbccea5494ff9be22f9e5d6 /src/wallet.js | |
| parent | f477756f5f04e65c68d2e51100c660c13505d1f2 (diff) | |
| download | coinosv3-8821cb2a5934f2a9ee12ae7b5c25664339421aff.tar.gz coinosv3-8821cb2a5934f2a9ee12ae7b5c25664339421aff.zip | |
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) <[email protected]>
Diffstat (limited to 'src/wallet.js')
| -rw-r--r-- | src/wallet.js | 4 |
1 files changed, 4 insertions, 0 deletions
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 }; } |
