diff options
Diffstat (limited to 'src/state/models/feed-view.ts')
-rw-r--r-- | src/state/models/feed-view.ts | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/src/state/models/feed-view.ts b/src/state/models/feed-view.ts index 645b1f2eb..ed5a32d8f 100644 --- a/src/state/models/feed-view.ts +++ b/src/state/models/feed-view.ts @@ -239,22 +239,33 @@ export class FeedModel { } get nonReplyFeed() { - const nonReplyFeed = this.feed.filter(item => { - const params = this.params as GetAuthorFeed.QueryParams - const isRepost = - item.reply && - (item?.reasonRepost?.by?.handle === params.author || - item?.reasonRepost?.by?.did === params.author) - - return ( - !item.reply || // not a reply - isRepost || - ((item._isThreadParent || // but allow if it's a thread by the user - item._isThreadChild) && - item.reply?.root.author.did === item.post.author.did) - ) - }) - return nonReplyFeed + if (this.feedType === 'author') { + return this.feed.filter(item => { + const params = this.params as GetAuthorFeed.QueryParams + const isRepost = + item.reply && + (item?.reasonRepost?.by?.handle === params.author || + item?.reasonRepost?.by?.did === params.author) + + return ( + !item.reply || // not a reply + isRepost || + ((item._isThreadParent || // but allow if it's a thread by the user + item._isThreadChild) && + item.reply?.root.author.did === item.post.author.did) + ) + }) + } else { + return this.feed.filter(item => { + const isRepost = Boolean(item?.reasonRepost) + return ( + !item.reply || // not a reply + isRepost || // but allow if it's a repost or thread + item._isThreadParent || + item._isThreadChild + ) + }) + } } setHasNewLatest(v: boolean) { @@ -423,6 +434,10 @@ export class FeedModel { if (!item) { return } + if (item.reply) { + // TEMPORARY ignore replies + return + } if (AppBskyFeedFeedViewPost.isReasonRepost(item.reason)) { if (item.reason.by.did === this.rootStore.me.did) { return // ignore reposts by the user |