bug: reaction with no e tag

This commit is contained in:
Kieran 2023-01-14 20:04:27 +00:00
parent 3fd5fd8568
commit 29f92b7cb2
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -12,9 +12,11 @@ export default function NoteReaction(props) {
const ev = props["data-ev"] || Event.FromObject(props.data);
const refEvent = useMemo(() => {
if(ev) {
if (ev) {
let eTags = ev.Tags.filter(a => a.Key === "e");
return eTags[0].Event;
if (eTags.length > 0) {
return eTags[0].Event;
}
}
return null;
}, [ev]);