Merge branch 'react-last' into 'main'

Use last e-tag as reacted event

See merge request soapbox-pub/ditto!362
This commit is contained in:
Alex Gleason 2024-06-06 16:29:07 +00:00
commit 3115c8d362
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);
}