Fix article note replies

This commit is contained in:
Bojan Mojsilovic 2024-06-18 14:50:51 +02:00
parent 940baae8a6
commit d419323f12

View File

@ -715,17 +715,21 @@ const Longform: Component< { naddr: string } > = (props) => {
let id = mention.id; let id = mention.id;
updateStore('page', 'mentions',
(mentions) => ({ ...mentions, [id]: { ...mention } })
);
if (mention.kind === Kind.LongForm) { if (mention.kind === Kind.LongForm) {
id = nip19.naddrEncode({ id = nip19.naddrEncode({
identifier: (mention.tags.find((t: string[]) => t[0] === 'd') || [])[1], identifier: (mention.tags.find((t: string[]) => t[0] === 'd') || [])[1],
pubkey: mention.pubkey, pubkey: mention.pubkey,
kind: mention.kind, kind: mention.kind,
}); });
}
updateStore('page', 'mentions', updateStore('page', 'mentions',
(mentions) => ({ ...mentions, [id]: { ...mention } }) (mentions) => ({ ...mentions, [id]: { ...mention } })
); );
}
return; return;
} }