From ce3893d8169cb63e982b57d18817c9155c2e874c Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 13 Sep 2024 22:30:09 +0100 Subject: [PATCH] Apply Following settings to Lists (#5313) * Apply Following settings to Lists * Remove dead code --- src/components/StarterPack/Main/PostsList.tsx | 2 +- src/state/preferences/feed-tuners.tsx | 26 +------------------ src/state/queries/post-feed.ts | 2 -- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/src/components/StarterPack/Main/PostsList.tsx b/src/components/StarterPack/Main/PostsList.tsx index c19c6bc6..0ff84ff4 100644 --- a/src/components/StarterPack/Main/PostsList.tsx +++ b/src/components/StarterPack/Main/PostsList.tsx @@ -18,7 +18,7 @@ interface ProfilesListProps { export const PostsList = React.forwardRef( function PostsListImpl({listUri, headerHeight, scrollElRef}, ref) { - const feed: FeedDescriptor = `list|${listUri}|as_following` + const feed: FeedDescriptor = `list|${listUri}` const {_} = useLingui() const onScrollToTop = useCallback(() => { diff --git a/src/state/preferences/feed-tuners.tsx b/src/state/preferences/feed-tuners.tsx index b6f14fae..3ed60e59 100644 --- a/src/state/preferences/feed-tuners.tsx +++ b/src/state/preferences/feed-tuners.tsx @@ -21,31 +21,7 @@ export function useFeedTuners(feedDesc: FeedDescriptor) { if (feedDesc.startsWith('feedgen')) { return [FeedTuner.preferredLangOnly(langPrefs.contentLanguages)] } - if (feedDesc.startsWith('list')) { - let feedTuners = [] - if (feedDesc.endsWith('|as_following')) { - // Same as Following tuners below, copypaste for now. - feedTuners.push(FeedTuner.removeOrphans) - if (preferences?.feedViewPrefs.hideReposts) { - feedTuners.push(FeedTuner.removeReposts) - } - if (preferences?.feedViewPrefs.hideReplies) { - feedTuners.push(FeedTuner.removeReplies) - } else { - feedTuners.push( - FeedTuner.followedRepliesOnly({ - userDid: currentAccount?.did || '', - }), - ) - } - if (preferences?.feedViewPrefs.hideQuotePosts) { - feedTuners.push(FeedTuner.removeQuotePosts) - } - feedTuners.push(FeedTuner.dedupThreads) - } - return feedTuners - } - if (feedDesc === 'following') { + if (feedDesc === 'following' || feedDesc.startsWith('list')) { const feedTuners = [FeedTuner.removeOrphans] if (preferences?.feedViewPrefs.hideReposts) { diff --git a/src/state/queries/post-feed.ts b/src/state/queries/post-feed.ts index ee3e2c14..7daf441a 100644 --- a/src/state/queries/post-feed.ts +++ b/src/state/queries/post-feed.ts @@ -51,7 +51,6 @@ type AuthorFilter = | 'posts_with_media' type FeedUri = string type ListUri = string -type ListFilter = 'as_following' // Applies current Following settings. Currently client-side. export type FeedDescriptor = | 'following' @@ -59,7 +58,6 @@ export type FeedDescriptor = | `feedgen|${FeedUri}` | `likes|${ActorDid}` | `list|${ListUri}` - | `list|${ListUri}|${ListFilter}` export interface FeedParams { mergeFeedEnabled?: boolean mergeFeedSources?: string[]