diff options
| author | Adam Soltys <[email protected]> | 2026-09-28 10:05:33 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-28 10:05:33 -0700 |
| commit | 3244074db89ad43ed909f83dc7ae2465f4cb109c (patch) | |
| tree | e8f1e07ac3a9cde2b93c11e869b6565f34640b98 /src | |
| parent | 1369f2ecc80c30df32dd8f6c5e2edcc70ee864b3 (diff) | |
| download | coinosv3-3244074db89ad43ed909f83dc7ae2465f4cb109c.tar.gz coinosv3-3244074db89ad43ed909f83dc7ae2465f4cb109c.zip | |
The first-ever zap tap's amount screen keeps the reader's place too.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VhUKyXKtsJ67QAFfb7QR9D
Diffstat (limited to 'src')
| -rw-r--r-- | src/features/messages.js | 5 |
1 files changed, 4 insertions, 1 deletions
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); |
