aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/zaps.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-18 23:12:19 -0700
committerAdam Soltys <[email protected]>2026-09-18 23:12:19 -0700
commite07023af899f6682e088aee9ff3329b16b8f467d (patch)
tree7b3f6926d476ebb3c41ad2f325a1029bf58d82aa /src/features/zaps.js
parent703ee6e1281e72ec00f65768d7de7a015c242abb (diff)
downloadcoinosv3-e07023af899f6682e088aee9ff3329b16b8f467d.tar.gz
coinosv3-e07023af899f6682e088aee9ff3329b16b8f467d.zip
Zaps: the sound, the sender, and one action bar for every post.
Tap feedback: a bolt strike, the amount popping off the button, the post trembling, and the zap.mp3 clip. The clip is 62KB of base64 and messages.js is boot code, so it is its own chunk, fetched once a zappable post is on screen and played inside the tap once loaded; the standalone build inlines it. Ark zap receipts are signed by the wallet key, which has no profile: they now carry the login identity as the sender (NIP-57's P tag), readers prefer it, and our own older receipts read as us. The action bar is the same six slots on every post: the zap button and the who-reacted chevron are always there (inert until they have something to do), so the first zap no longer reflows the row, and you can zap your own posts and messages. Community rows centre their unread dot off the edge. Also in here: reactions with custom emoji, reply-composer focus under the tapped post, profile fetch retry, and Lightning zap failures that say so. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Diffstat (limited to 'src/features/zaps.js')
-rw-r--r--src/features/zaps.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/features/zaps.js b/src/features/zaps.js
index 77f8475..54c8f58 100644
--- a/src/features/zaps.js
+++ b/src/features/zaps.js
@@ -214,7 +214,7 @@ export function zapsFeature(ctx) {
}
const invoice = await requestInvoice(p, { amountMsat: msat, zapRequest, lnurlBech32: t2.lnurlBech32 });
await hook('arkPayInvoice', invoice, { maxAmountSat: sats + 50 });
- toast('⚡ ' + t('zapSentShort', { n: fmtAmount(sats) + ' ' + unitLabel() }));
+ if (!target.eventId) toast('⚡ ' + t('zapSentShort', { n: fmtAmount(sats) + ' ' + unitLabel() }));
render();
}
@@ -454,10 +454,13 @@ export function zapsFeature(ctx) {
// this went, either way
autoZap({ kind: 'npub', pk, eventId: eventId || null }, autoSat)
.then(() => hook('zapSettled', eventId, true, autoSat))
- .catch((e) => { hook('zapSettled', eventId, false); toast('⚡ ' + e.message); });
+ .catch((e) => { hook('zapSettled', eventId, false); toast('⚡ ' + (e.message || t('lnZapFailed')), 4000); });
return true;
}
- if (autoSat) hook('zapSettled', eventId, false); // one tap couldn't serve it — the form takes over
+ if (autoSat) {
+ hook('zapSettled', eventId, false);
+ if (eventId) { toast('⚡ ' + t('lnZapFailed'), 4000); return true; }
+ }
begin({ kind: 'npub', pk, eventId: eventId || null }, shortNpub(npub || npubOf(pk)));
return true;
},