From 630773717478456879831abecb441e04e5426caf Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 2 Aug 2026 17:42:08 -0700 Subject: One global account: you're in Spending or Savings everywhere MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The balance card's label becomes a Spending/Savings toggle and the selection is app-wide state (persisted per device): the headline shows the selected balance with the other quiet below, Receive shows the payment address in Spending and a fresh on-chain address in Savings (the per-page dropdown and its iconSelect widget are gone), and a gift's source follows the account instead of its own toggle. Wallets without Ark see the old single-balance card. Send stays destination-driven — an invoice pays from Spending, an address from Savings, as before. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi --- src/features/gifts.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/features') diff --git a/src/features/gifts.js b/src/features/gifts.js index 740b9f8..bc16619 100644 --- a/src/features/gifts.js +++ b/src/features/gifts.js @@ -504,17 +504,13 @@ export function giftsFeature(ctx) { ); })() : h('div', { class: 'col gap6' }, - // Source toggle: gift on-chain coins (presigned link, coins locked - // until claim) or the ark balance (instant bearer vtxo, no lock). + // The gift's source follows the global account selection: in + // Spending the gift is an instant ark bearer vtxo, in Savings a + // presigned on-chain link (coins locked until claim). (() => { const info = hook('arkGiftInfo'); - if (!info || info.spendableSat <= 0) { if (ui.giftSource === 'ark') ui.giftSource = 'chain'; return null; } - const src = ui.giftSource || 'chain'; - const btn = (id, label) => h('button', { - type: 'button', class: (src === id ? 'btn-primary' : 'btn-ghost') + ' grow', - onClick: () => { ui.giftSource = id; ui.giftError = ''; render(); }, - }, label); - return h('div', { class: 'row gap6' }, btn('chain', t('giftSourceChain')), btn('ark', t('giftSourceArk'))); + ui.giftSource = ctx.getAccount() === 'spending' && info ? 'ark' : 'chain'; + return null; })(), (() => { const isArk = ui.giftSource === 'ark'; -- cgit v1.2.3