From 3244074db89ad43ed909f83dc7ae2465f4cb109c Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 28 Sep 2026 10:05:33 -0700 Subject: The first-ever zap tap's amount screen keeps the reader's place too. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01VhUKyXKtsJ67QAFfb7QR9D --- src/features/messages.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/features') diff --git a/src/features/messages.js b/src/features/messages.js index b53d321..5bdd7a6 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -5598,7 +5598,10 @@ export function messagesFeature(ctx) { function zapNote(pk, ev, origin) { const npubStr = npubOf(pk); const def = ctx.zapDefaultSat ? ctx.zapDefaultSat() : 0; - if (!def) { ui.zapSetup = { pk, npub: npubStr, eventId: ev.id, amount: '21', origin }; render(); return; } + if (!def) { // the first tap ever sets the amount; the reader's place is kept for the way back + let scrollY = 0; try { scrollY = window.scrollY || 0; } catch {} + ui.zapSetup = { pk, npub: npubStr, eventId: ev.id, amount: '21', origin, scrollY }; render(); return; + } markZapPending(ev.id, def, origin); // strike now; settlement only corrects the tally if (!hook('zapNpub', pk, npubStr, ev.id, def) && !hook('lnZapNpub', pk, npubStr, ev.id, def)) { settleZap(ev.id, false); -- cgit v1.2.3