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:
commit
3115c8d362
|
@ -99,7 +99,7 @@ export function assembleEvents(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.kind === 7) {
|
if (event.kind === 7) {
|
||||||
const id = event.tags.find(([name]) => name === 'e')?.[1];
|
const id = event.tags.findLast(([name]) => name === 'e')?.[1];
|
||||||
if (id) {
|
if (id) {
|
||||||
event.reacted = b.find((e) => matchFilter({ kinds: [1], ids: [id] }, e));
|
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) {
|
for (const event of events) {
|
||||||
if (event.kind === 7) {
|
if (event.kind === 7) {
|
||||||
const id = event.tags.find(([name]) => name === 'e')?.[1];
|
const id = event.tags.findLast(([name]) => name === 'e')?.[1];
|
||||||
if (id) {
|
if (id) {
|
||||||
ids.add(id);
|
ids.add(id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue