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