Apply Following settings to Lists (#5313)
* Apply Following settings to Lists * Remove dead code
This commit is contained in:
parent
88813f57c9
commit
ce3893d816
3 changed files with 2 additions and 28 deletions
|
@ -18,7 +18,7 @@ interface ProfilesListProps {
|
||||||
|
|
||||||
export const PostsList = React.forwardRef<SectionRef, ProfilesListProps>(
|
export const PostsList = React.forwardRef<SectionRef, ProfilesListProps>(
|
||||||
function PostsListImpl({listUri, headerHeight, scrollElRef}, ref) {
|
function PostsListImpl({listUri, headerHeight, scrollElRef}, ref) {
|
||||||
const feed: FeedDescriptor = `list|${listUri}|as_following`
|
const feed: FeedDescriptor = `list|${listUri}`
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
|
|
||||||
const onScrollToTop = useCallback(() => {
|
const onScrollToTop = useCallback(() => {
|
||||||
|
|
|
@ -21,31 +21,7 @@ export function useFeedTuners(feedDesc: FeedDescriptor) {
|
||||||
if (feedDesc.startsWith('feedgen')) {
|
if (feedDesc.startsWith('feedgen')) {
|
||||||
return [FeedTuner.preferredLangOnly(langPrefs.contentLanguages)]
|
return [FeedTuner.preferredLangOnly(langPrefs.contentLanguages)]
|
||||||
}
|
}
|
||||||
if (feedDesc.startsWith('list')) {
|
if (feedDesc === 'following' || 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') {
|
|
||||||
const feedTuners = [FeedTuner.removeOrphans]
|
const feedTuners = [FeedTuner.removeOrphans]
|
||||||
|
|
||||||
if (preferences?.feedViewPrefs.hideReposts) {
|
if (preferences?.feedViewPrefs.hideReposts) {
|
||||||
|
|
|
@ -51,7 +51,6 @@ type AuthorFilter =
|
||||||
| 'posts_with_media'
|
| 'posts_with_media'
|
||||||
type FeedUri = string
|
type FeedUri = string
|
||||||
type ListUri = string
|
type ListUri = string
|
||||||
type ListFilter = 'as_following' // Applies current Following settings. Currently client-side.
|
|
||||||
|
|
||||||
export type FeedDescriptor =
|
export type FeedDescriptor =
|
||||||
| 'following'
|
| 'following'
|
||||||
|
@ -59,7 +58,6 @@ export type FeedDescriptor =
|
||||||
| `feedgen|${FeedUri}`
|
| `feedgen|${FeedUri}`
|
||||||
| `likes|${ActorDid}`
|
| `likes|${ActorDid}`
|
||||||
| `list|${ListUri}`
|
| `list|${ListUri}`
|
||||||
| `list|${ListUri}|${ListFilter}`
|
|
||||||
export interface FeedParams {
|
export interface FeedParams {
|
||||||
mergeFeedEnabled?: boolean
|
mergeFeedEnabled?: boolean
|
||||||
mergeFeedSources?: string[]
|
mergeFeedSources?: string[]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue