Use last e-tag as reacted event

This commit is contained in:
Alex Gleason 2024-06-06 11:25:24 -05:00
parent 20b11b686b
commit 77ce26bf7a
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 2 additions and 2 deletions

View File

@ -99,7 +99,7 @@ export function assembleEvents(
}
if (event.kind === 7) {
const id = event.tags.find(([name]) => name === 'e')?.[1];
const id = event.tags.findLast(([name]) => name === 'e')?.[1];
if (id) {
event.reacted = b.find((e) => matchFilter({ kinds: [1], ids: [id] }, e));
}
@ -154,7 +154,7 @@ function gatherReacted({ events, store, signal }: HydrateOpts): Promise<DittoEve
for (const event of events) {
if (event.kind === 7) {
const id = event.tags.find(([name]) => name === 'e')?.[1];
const id = event.tags.findLast(([name]) => name === 'e')?.[1];
if (id) {
ids.add(id);
}