aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/zaps.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/zaps.js')
-rw-r--r--src/features/zaps.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/features/zaps.js b/src/features/zaps.js
index 8e29409..49e457f 100644
--- a/src/features/zaps.js
+++ b/src/features/zaps.js
@@ -12,6 +12,7 @@
// land here directly.
import { t } from '../i18n.js';
+import { momentToggle, mediaClock } from '../media-timeline.js';
import { npubOf } from '../nostr.js';
import { parseZapTarget, zapTargetFromProfile, fetchPayParams, buildZapRequest, requestInvoice, parseLnurlAuth, lnurlAuthKey, lnurlAuthLogin, submitWithdraw } from '../lnurl.js';
import { HDKey } from '@scure/bip32';
@@ -213,7 +214,8 @@ export function zapsFeature(ctx) {
const profile = await wallet.nostrProfile(target.pk);
const lnTarget = zapTargetFromProfile(profile, target.pk);
if (!lnTarget) throw new Error(t('lnZapNoAddress'));
- const t2 = { ...lnTarget, eventId: target.eventId || null, moment: target.moment };
+ // a one-tap zap has no sheet to tick: never tied to a moment
+ const t2 = { ...lnTarget, eventId: target.eventId || null, moment: null };
const p = await fetchPayParams(t2.url);
const msat = sats * 1000;
if (msat < p.minSendable || msat > p.maxSendable) {
@@ -286,7 +288,7 @@ export function zapsFeature(ctx) {
const sign = await zapSigner();
zapRequest = await buildZapRequest({
amountMsat: msat, relays: wallet.nostrRelays(), lnurlBech32: z.target.lnurlBech32,
- recipientPk: z.target.pk, eventId: z.target.eventId || null, moment: z.target.moment, comment: z.comment,
+ recipientPk: z.target.pk, eventId: z.target.eventId || null, moment: z.momentOn ? z.target.moment : null, comment: z.comment,
signFn: sign,
});
}
@@ -517,6 +519,8 @@ export function zapsFeature(ctx) {
maxlength: p.allowsNostr ? '280' : String(p.commentAllowed || 280),
onInput: (e) => { z.comment = e.target.value; } })
: null,
+ p.allowsNostr && z.target && z.target.moment ? h('div', { class: 'row' }, momentToggle(h, z.target.moment, !!z.momentOn, (on) => { z.momentOn = on; render(); },
+ t('mediaTieTo', { time: mediaClock(z.target.moment.seconds) }))) : null,
z.social ? h('div', { class: 'small faint' }, p.allowsNostr ? t('lnZapHintNostr') : t('lnZapHintPlain')) : null),
z.error ? h('div', { class: 'notice err' }, z.error) : null,
h('div', { class: 'row gap6' },