Skip to content

Commit

Permalink
REQ if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowCait committed Oct 16, 2023
1 parent 608b2b6 commit 7098ce1
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions web/src/lib/timelines/MainTimeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,23 @@ export function referencesReqEmit(event: Event): void {
}

const $eventItemStore = get(eventItemStore);
eventsReq.emit({
ids: [
...new Set([
...event.tags
.filter(
([tagName, id]) =>
tagName === 'e' && id !== undefined && !$eventItemStore.has(id)
)
.map(([, id]) => id),
...Content.findNotesAndNeventsToIds(event.content)
])
]
});
const ids = [
...new Set([
...event.tags
.filter(
([tagName, id]) =>
tagName === 'e' && id !== undefined && !$eventItemStore.has(id)
)
.map(([, id]) => id),
...Content.findNotesAndNeventsToIds(event.content)
])
];

if (ids.length > 0) {
eventsReq.emit({
ids
});
}
}

rxNostr
Expand Down

0 comments on commit 7098ce1

Please sign in to comment.