feat: add home feed preferences settings modal and tuners

This commit is contained in:
Eric Bailey 2023-06-16 14:59:29 -05:00
parent 17e7590bcd
commit 896aea9837
8 changed files with 304 additions and 16 deletions

View file

@ -115,6 +115,12 @@ export class PostsFeedModel {
}
get feedTuners() {
const areRepliesEnabled = this.rootStore.preferences.homeFeedRepliesEnabled
const repliesThreshold = this.rootStore.preferences.homeFeedRepliesThreshold
const areRepostsEnabled = this.rootStore.preferences.homeFeedRepostsEnabled
const areQuotePostsEnabled =
this.rootStore.preferences.homeFeedQuotePostsEnabled
if (this.feedType === 'custom') {
return [
FeedTuner.dedupReposts,
@ -124,7 +130,13 @@ export class PostsFeedModel {
]
}
if (this.feedType === 'home') {
return [FeedTuner.dedupReposts, FeedTuner.likedRepliesOnly]
return [
areRepostsEnabled && FeedTuner.dedupReposts,
!areRepostsEnabled && FeedTuner.removeReposts,
areRepliesEnabled && FeedTuner.likedRepliesOnly({repliesThreshold}),
!areRepliesEnabled && FeedTuner.removeReplies,
!areQuotePostsEnabled && FeedTuner.removeQuotePosts,
].filter(Boolean)
}
return []
}