diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/app.js | 13 | ||||
| -rw-r--r-- | src/features/ark.js | 2 | ||||
| -rw-r--r-- | src/features/messages.js | 4 |
3 files changed, 15 insertions, 4 deletions
@@ -112,6 +112,17 @@ const ui = { busy: false, }; +// Take the wallet to the Send pane: any payment detail left open (a tapped +// history row — which claims the whole tab area, whichever tab is picked) +// closes first. A feature that jumped straight to ui.tab = 'send' used to +// land on a renewal's detail card instead of the form. +function showSend() { + ui.txDetail = null; ui.arkMoveDetail = null; ui.arkReconDetail = null; ui.arkExitDetail = null; ui.giftDetail = null; + ui.bump = null; + ui.sendError = ''; + ui.tab = 'send'; +} + function blankSend() { return { recipients: [{ address: '', amount: '' }], @@ -5315,7 +5326,7 @@ async function importSnapshotFile(e) { // sits just before boot so every helper it captures is defined; the hooks are // only invoked at runtime (first render happens after loadLocale below). const ctx = { - h, ui, render, wallet, toast, copy, copyBtn, pasteBtn, blankSend, goBack, goHome, openExternal, + h, ui, render, wallet, toast, copy, copyBtn, pasteBtn, blankSend, goBack, goHome, openExternal, showSend, fmtAmount, unitLabel, unitTag, getUnit: () => unit, toggleUnit, download, // in fiat the typed figure is money, so it needs today's price to become sats parseAmount: (v, u) => parseAmount(v, u, rateNow()), diff --git a/src/features/ark.js b/src/features/ark.js index ea273b8..93578da 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -1546,7 +1546,7 @@ export function arkFeature(ctx) { const bail = () => { if (!z.autoSat) return; // a form zap: the card keeps the screen and its own status ctx.hook('zapSettled', z.eventId, false); - z.autoSat = 0; ui.tab = 'send'; + z.autoSat = 0; ctx.showSend(); }; // an instant zap: resolution succeeded — pay the default amount now, no // form, and report by toast; failures fall back to the classic form diff --git a/src/features/messages.js b/src/features/messages.js index 6314a58..60e87f8 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -4206,7 +4206,7 @@ export function messagesFeature(ctx) { settleZap(ev.id, false); ui.profilePk = null; ui.chatOpen = false; - ui.tab = 'send'; + ctx.showSend(); render(); if (!hook('zapNpub', pk, npubStr, ev.id)) hook('lnZapNpub', pk, npubStr, ev.id); } @@ -5233,7 +5233,7 @@ export function messagesFeature(ctx) { ui.noteThread = null; ui.userSearch = null; ui.chatOpen = false; - ui.tab = 'send'; + ctx.showSend(); // and never a lingering payment detail render(); hook('matchSendText', npubStr); } }, t('profPay')), |
