diff options
| author | Adam Soltys <[email protected]> | 2026-09-23 14:10:40 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-23 14:10:40 -0700 |
| commit | fb170b4783c9b49c73e926c08aba9bc4d1bb418e (patch) | |
| tree | e646032c5efd4789c9e3a0b2efb0345ecc5eafc3 /src | |
| parent | c6070c1891f4712b23397746f6aab1e2f070c3f8 (diff) | |
| download | coinosv3-fb170b4783c9b49c73e926c08aba9bc4d1bb418e.tar.gz coinosv3-fb170b4783c9b49c73e926c08aba9bc4d1bb418e.zip | |
Always offer coin management for a Spending balance
Diffstat (limited to 'src')
| -rw-r--r-- | src/features/ark.js | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/features/ark.js b/src/features/ark.js index 73f4503..0b90520 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -2149,10 +2149,16 @@ export function arkFeature(ctx) { const mgr = ark; const st = (mgr && mgr.state) || arkStateNow(); const spend = ((st && st.vtxos) || []).filter((v) => v.state === 'spendable'); + const pendingSat = (arkBalance() || {}).pendingSat || 0; const tip = (mgr && mgr._tipH) || 0; const back = () => { ui.arkCoinsPage = null; ui.arkCoinsSel = null; render(); }; - if (!spend.length) { ui.arkCoinsPage = null; return null; } // nothing left to manage + if (!spend.length && !pendingSat) { ui.arkCoinsPage = null; return null; } // nothing left to manage if (!mgr) connectArk().then(() => render()).catch(() => {}); + if (!spend.length) return h('div', { class: 'col', style: 'gap:16px' }, + h('div', { class: 'card col', style: 'gap:8px' }, + h('h3', {}, t('arkCoinsTitle')), + h('div', { class: 'small muted' }, t('pending'), ': ', fmtSats(pendingSat), ' sats')), + h('button', { class: 'btn-ghost btn-block', onClick: back }, t('back'))); const totalSat = spend.reduce((n, v) => n + v.amountSat, 0); let exitFee = 0; try { exitFee = estimateExitFeeSat(mgr); } catch {} const feeRate = Math.max(1, (wallet.feeRates && wallet.feeRates.halfHourFee) || 2); @@ -3800,15 +3806,16 @@ export function arkFeature(ctx) { } } const manageBtn = () => h('button', { class: 'linklike small', style: 'align-self:flex-end', onClick: () => { ui.arkCoinsPage = true; render(); } }, t('arkDepthBtn')); - // Nothing to warn about: the coins page is still a tap away — its - // renewal schedule and exit cost are worth a look even when all is well. + // Management follows the Spending balance, independently of notices + // or renewal eligibility. Keep expired coins reachable as well. + const balance = arkBalance(); + const coins = (arkStateNow()?.vtxos || []).some((v) => v.state === 'spendable'); + const hasBalance = balance && balance.spendableSat + balance.pendingSat > 0; + const manage = hasBalance || coins || lines.some((l) => l.manage) ? manageBtn() : null; if (!lines.length) { - const st = arkStateNow(); - const coins = st ? (st.vtxos || []).some((v) => v.state === 'spendable') : false; - return coins ? [h('div', { class: 'small muted', style: 'margin:10px 0 0;text-align:center' }, manageBtn())] : []; + return manage ? [h('div', { class: 'small muted', style: 'margin:10px 0 0;text-align:center' }, manage)] : []; } const err = lines.some((l) => l.err); - const manage = lines.some((l) => l.manage) ? manageBtn() : null; // one plain advisory keeps its quiet centred line; anything more, or // anything urgent, is a card if (!err && lines.length === 1) { |
