From d654e2d1cb76aa4d1032db2c424b7937e44b9429 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 10 Sep 2026 21:53:46 -0700 Subject: The zap chip lands on the tap and pulses until the payment settles. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A zap took a few seconds to pay and its public receipt trailed that by seconds more, so the tally chip appeared long after the tap — the tap looked ignored, and the only way to tell it had worked was the toast. Now the chip appears on the tap carrying your amount, breathing while the payment is in flight; it goes solid the moment the payment lands, and steps aside when the real receipt arrives (which is also how it avoids counting your zap twice). The ark and Lightning one-tap flows report their outcome back — a failure, or a fallback into the form, takes the chip straight off again rather than leaving it pulsing. An unreported zap gives up after 45s. A zap sent from the form reports too, so the tally shows it right away instead of waiting on a relay. Reduced-motion gets a dimmed chip, no pulse. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_019mrt228Upn9nNCwGixzSLx --- src/features/zaps.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/features/zaps.js') diff --git a/src/features/zaps.js b/src/features/zaps.js index 3c0e7e1..77f8475 100644 --- a/src/features/zaps.js +++ b/src/features/zaps.js @@ -450,10 +450,14 @@ export function zapsFeature(ctx) { lnZapNpub(pk, npub, eventId, autoSat) { if (!canPay() || !wallet.nostrProfile) return false; if (autoSat && hook('arkReady')) { + // the chip on the zapped note is pulsing since the tap — tell it how + // this went, either way autoZap({ kind: 'npub', pk, eventId: eventId || null }, autoSat) - .catch((e) => toast('⚡ ' + e.message)); + .then(() => hook('zapSettled', eventId, true, autoSat)) + .catch((e) => { hook('zapSettled', eventId, false); toast('⚡ ' + e.message); }); return true; } + if (autoSat) hook('zapSettled', eventId, false); // one tap couldn't serve it — the form takes over begin({ kind: 'npub', pk, eventId: eventId || null }, shortNpub(npub || npubOf(pk))); return true; }, -- cgit v1.2.3