aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-02 17:42:08 -0700
committerAdam Soltys <[email protected]>2026-08-02 17:42:08 -0700
commit630773717478456879831abecb441e04e5426caf (patch)
treeac96dc650befb3e7b1a7b3ee0a2e8b9d8a177847 /src/features
parentb869eefac239a47d33260e53edbd7497dc023759 (diff)
downloadcoinosv3-630773717478456879831abecb441e04e5426caf.tar.gz
coinosv3-630773717478456879831abecb441e04e5426caf.zip
One global account: you're in Spending or Savings everywhere
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 <[email protected]> Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi
Diffstat (limited to 'src/features')
-rw-r--r--src/features/gifts.js14
1 files changed, 5 insertions, 9 deletions
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';