fix: unknown thread context
This commit is contained in:
parent
76a561624c
commit
08d4a73ca6
@ -20,12 +20,11 @@ export function getNotificationContext(ev: TaggedNostrEvent) {
|
||||
case EventKind.Repost:
|
||||
case EventKind.Reaction: {
|
||||
const thread = Nip10.parseThread(ev);
|
||||
const tag = thread?.replyTo ?? thread?.root;
|
||||
const tag = thread?.replyTo ?? thread?.root ?? thread?.mentions[0];
|
||||
if (tag) {
|
||||
return tag;
|
||||
} else {
|
||||
throw new Error("Unknown thread context");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EventKind.TextNote: {
|
||||
return NostrLink.fromEvent(ev);
|
||||
|
Loading…
x
Reference in New Issue
Block a user