aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-07-06 10:18:52 -0700
committerAdam Soltys <[email protected]>2026-07-06 10:18:52 -0700
commite74b576c8641627a700ffa82fd7179b8cf84993d (patch)
treebc590cd517d1614e7677f73266136cd32e11d5e5
parentd838a91ada7a5d7d91e4ee42fb34e001f9a5a1b6 (diff)
downloadcoinosv3-e74b576c8641627a700ffa82fd7179b8cf84993d.tar.gz
coinosv3-e74b576c8641627a700ffa82fd7179b8cf84993d.zip
Show ark balance for watch-only wallets (read from persisted state)
After a refresh a wallet reverts to watch-only unless the seed was saved to device — and ark balance/history were gated behind arkAvailable() (which excludes watch-only), so the on-chain balance showed but the ark balance vanished. The ark state is persisted locally and should display read-only exactly like the on-chain balance. arkStateNow() now reads it whenever Ark is configured for the network, regardless of watch-only; the Exit link (which needs keys to act) is hidden for watch-only. Verified: full wallet shows balance + Exit link, a locked/watch-only wallet shows the balance alone. Co-Authored-By: Claude Fable 5 <[email protected]>
-rw-r--r--src/features/ark.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/features/ark.js b/src/features/ark.js
index 36aecf2..ba509aa 100644
--- a/src/features/ark.js
+++ b/src/features/ark.js
@@ -204,7 +204,11 @@ export function arkFeature(ctx) {
// flickering (empty → populated) while the manager connects asynchronously.
function arkStateNow() {
if (ark && ark.state) return ark.state;
- if (!arkAvailable()) return null;
+ // Read persisted state whenever Ark is configured for this network — even
+ // watch-only (seed not loaded this session): the balance/history should
+ // show read-only, just like the on-chain balance does. Acting on it
+ // (send/exit) still requires the seed and is gated separately.
+ if (!getArkConfig()) return null;
return wallet.loadArkState();
}
@@ -1094,9 +1098,12 @@ export function arkFeature(ctx) {
const lines = [];
if (b.spendableSat + b.pendingSat > 0) {
// "Ark balance … Exit" — the exit link opens the offboard/exit page.
- const label = h('span', { class: 'row gap6', style: 'align-items:center' },
- t('arkBalance'),
- h('span', { class: 'linklike', style: 'font-size:12px', onClick: () => { ui.arkExitPage = true; ui.arkError = ''; render(); } }, t('arkExitLink')));
+ // Watch-only wallets can't move funds, so they just show the balance.
+ const label = wallet.watchOnly
+ ? t('arkBalance')
+ : h('span', { class: 'row gap6', style: 'align-items:center' },
+ t('arkBalance'),
+ h('span', { class: 'linklike', style: 'font-size:12px', onClick: () => { ui.arkExitPage = true; ui.arkError = ''; render(); } }, t('arkExitLink')));
lines.push({ label, sat: b.spendableSat + b.pendingSat });
}
// A board in flight: the sats already left the on-chain balance, so show