store events in SortedMap to avoid sort on render

This commit is contained in:
Martti Malmi
2024-01-04 18:11:38 +02:00
parent 47d92fe171
commit 5d259cee95
6 changed files with 239 additions and 5 deletions

View File

@ -53,7 +53,6 @@ const Timeline = (props: TimelineProps) => {
return followDistance === props.followDistance;
};
const a = [...nts.filter(a => a.kind !== EventKind.LiveEvent)];
props.noSort || a.sort((a, b) => b.created_at - a.created_at);
return a
?.filter(a => (props.postsOnly ? !a.tags.some(b => b[0] === "e") : true))
.filter(a => (props.ignoreModeration || !isEventMuted(a)) && checkFollowDistance(a));