From 7d6b7d2fa6ec074db3f38785e46834f826c82772 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Sat, 23 Dec 2023 15:16:23 -0800 Subject: [PATCH] Fix some account filtering behaviors (#2290) * Fix: don't filter ProfileCards out of certain lists * Fix: don't filter ProfileCards and autocomplete based on mutes --- src/state/queries/actor-autocomplete.ts | 2 +- src/view/com/lists/ListMembers.tsx | 1 + src/view/com/profile/ProfileCard.tsx | 8 +++++++- src/view/screens/ModerationBlockedAccounts.tsx | 1 + src/view/screens/ModerationMutedAccounts.tsx | 1 + 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/state/queries/actor-autocomplete.ts b/src/state/queries/actor-autocomplete.ts index 709a15b4..785e2976 100644 --- a/src/state/queries/actor-autocomplete.ts +++ b/src/state/queries/actor-autocomplete.ts @@ -112,7 +112,7 @@ function computeSuggestions( } return items.filter(profile => { const mod = moderateProfile(profile, moderationOpts) - return !mod.account.filter + return !mod.account.filter && mod.account.cause?.type !== 'muted' }) } diff --git a/src/view/com/lists/ListMembers.tsx b/src/view/com/lists/ListMembers.tsx index 2aef7d76..932f4b51 100644 --- a/src/view/com/lists/ListMembers.tsx +++ b/src/view/com/lists/ListMembers.tsx @@ -180,6 +180,7 @@ export function ListMembers({ profile={(item as AppBskyGraphDefs.ListItemView).subject} renderButton={renderMemberButton} style={{paddingHorizontal: isMobile ? 8 : 14, paddingVertical: 4}} + noModFilter /> ) }, diff --git a/src/view/com/profile/ProfileCard.tsx b/src/view/com/profile/ProfileCard.tsx index c5b2dc52..ef95f592 100644 --- a/src/view/com/profile/ProfileCard.tsx +++ b/src/view/com/profile/ProfileCard.tsx @@ -27,6 +27,7 @@ import {useSession} from '#/state/session' export function ProfileCard({ testID, profile: profileUnshadowed, + noModFilter, noBg, noBorder, followers, @@ -35,6 +36,7 @@ export function ProfileCard({ }: { testID?: string profile: AppBskyActorDefs.ProfileViewBasic + noModFilter?: boolean noBg?: boolean noBorder?: boolean followers?: AppBskyActorDefs.ProfileView[] | undefined @@ -50,7 +52,11 @@ export function ProfileCard({ return null } const moderation = moderateProfile(profile, moderationOpts) - if (moderation.account.filter) { + if ( + !noModFilter && + moderation.account.filter && + moderation.account.cause?.type !== 'muted' + ) { return null } diff --git a/src/view/screens/ModerationBlockedAccounts.tsx b/src/view/screens/ModerationBlockedAccounts.tsx index 8f6e2f72..bada3ea9 100644 --- a/src/view/screens/ModerationBlockedAccounts.tsx +++ b/src/view/screens/ModerationBlockedAccounts.tsx @@ -92,6 +92,7 @@ export function ModerationBlockedAccounts({}: Props) { testID={`blockedAccount-${index}`} key={item.did} profile={item} + noModFilter /> ) return ( diff --git a/src/view/screens/ModerationMutedAccounts.tsx b/src/view/screens/ModerationMutedAccounts.tsx index 41aee9f2..67118e53 100644 --- a/src/view/screens/ModerationMutedAccounts.tsx +++ b/src/view/screens/ModerationMutedAccounts.tsx @@ -92,6 +92,7 @@ export function ModerationMutedAccounts({}: Props) { testID={`mutedAccount-${index}`} key={item.did} profile={item} + noModFilter /> ) return (