feat: update topic lists

This commit is contained in:
2023-11-13 22:55:51 +00:00
parent 24978f4e62
commit 81d6f41050
5 changed files with 287 additions and 32 deletions

View File

@ -34,14 +34,14 @@ const Timeline = (props: TimelineProps) => {
}, [props]);
const feed: TimelineFeed = useTimelineFeed(props.subject, feedOptions);
const { muted, isMuted } = useModeration();
const { muted, isEventMuted } = useModeration();
const filterPosts = useCallback(
(nts: readonly TaggedNostrEvent[]) => {
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 || !isMuted(a.pubkey));
.filter(a => props.ignoreModeration || !isEventMuted(a));
},
[props.postsOnly, muted, props.ignoreModeration],
);