bug: timeline posts only

This commit is contained in:
Kieran 2023-03-29 14:08:45 +01:00
parent 96eefe6080
commit 8df44cd748
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 1 additions and 2 deletions

View File

@ -1,6 +1,5 @@
import { RawEvent } from "@snort/nostr";
import { db } from "Db";
import { dedupe } from "Util";
import FeedCache from "./FeedCache";
class DMCache extends FeedCache<RawEvent> {

View File

@ -47,7 +47,7 @@ const Timeline = (props: TimelineProps) => {
(nts: readonly TaggedRawEvent[]) => {
return [...nts]
.sort((a, b) => b.created_at - a.created_at)
?.filter(a => (props.postsOnly ? !a.tags.some(b => b[0] === "e") : a.tags.some(b => b[0] === "e")))
?.filter(a => (props.postsOnly ? !a.tags.some(b => b[0] === "e") : true))
.filter(a => props.ignoreModeration || !isMuted(a.pubkey));
},
[props.postsOnly, muted, props.ignoreModeration]