cleanup
This commit is contained in:
@ -58,6 +58,7 @@ export function NoteCreator(props: NoteCreatorProps) {
|
||||
try {
|
||||
const svc = new LNURL(zapForward);
|
||||
await svc.load();
|
||||
extraTags = [svc.getZapTag()];
|
||||
} catch {
|
||||
setError(
|
||||
formatMessage({
|
||||
@ -66,7 +67,6 @@ export function NoteCreator(props: NoteCreatorProps) {
|
||||
);
|
||||
return;
|
||||
}
|
||||
extraTags = [["zap", zapForward]];
|
||||
}
|
||||
const ev = replyTo ? await publisher.reply(replyTo, note, extraTags) : await publisher.note(note, extraTags);
|
||||
console.debug("Sending note: ", ev);
|
||||
|
@ -154,11 +154,16 @@ export default function NoteFooter(props: NoteFooterProps) {
|
||||
}
|
||||
|
||||
function getLNURL() {
|
||||
return ev.Tags.find(a => a.Key === "zap")?.LNURL || author?.lud16 || author?.lud06;
|
||||
return ev.tags.find(a => a[0] === "zap")?.[1] || author?.lud16 || author?.lud06;
|
||||
}
|
||||
|
||||
function getTargetName() {
|
||||
return ev.Tags.find(a => a.Key === "zap")?.LNURL || author?.display_name || author?.name;
|
||||
const zapTarget = ev.tags.find(a => a[0] === "zap")?.[1];
|
||||
if (zapTarget) {
|
||||
return new LNURL(zapTarget).name;
|
||||
} else {
|
||||
return author?.display_name || author?.name;
|
||||
}
|
||||
}
|
||||
|
||||
async function fastZap(e?: React.MouseEvent) {
|
||||
|
Reference in New Issue
Block a user