From 97be87fcea0bc24f553e8a9814de7a2825624cec Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 28 Aug 2026 12:47:07 -0700 Subject: A send can't quietly change accounts: pasting an on-chain address in Spending while every coin is mid-exit now opens the exit's own status page — before, it fell through to the Savings send form, whose fee-trimmed Max read as the spending balance shrinking by half MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_019eA8JRq9Wr7z2fRQk99HLi --- src/features/ark.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/features/ark.js b/src/features/ark.js index 2695183..e98ecc3 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -2294,12 +2294,25 @@ export function arkFeature(ctx) { const inv = (text || '').trim().replace(/^lightning:/i, ''); // In a Spending wallet an on-chain address means "exit ark to there": // the offboard happens right in the send flow, no Move money ceremony. - if (ctx.getAccount() === 'spending' && wallet.isOnchainAddress(inv) - && arkAvailable() && (arkBalance()?.spendableSat || 0) > 0) { - ui.arkOffboardSend = { address: inv, amount: '' }; - ui.sendError = ''; - render(); - return true; + if (ctx.getAccount() === 'spending' && wallet.isOnchainAddress(inv) && arkAvailable()) { + const b = arkBalance() || {}; + if ((b.spendableSat || 0) > 0) { + ui.arkOffboardSend = { address: inv, amount: '' }; + ui.sendError = ''; + render(); + return true; + } + // Every coin is mid-exit: the balance face still shows the pending + // sats, so falling through to the SAVINGS send form here read as the + // spending send silently swapping accounts (fee-adjusted Max and + // all). Show the exit's status instead — that's where the money is. + if ((b.pendingSat || 0) > 0 + && (arkStateNow()?.actions || []).some((a) => a.type === 'exit' && !['done', 'failed'].includes(a.step))) { + ui.arkExitPage = true; + ui.sendError = ''; + render(); + return true; + } } if (maybeBolt11(inv)) return startArkLnPay(inv); const pk = npubToHex(text); -- cgit v1.2.3