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
zio/stable
Paul Frazee 2023-12-23 15:16:23 -08:00 committed by GitHub
parent b922b83820
commit 7d6b7d2fa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 2 deletions

View File

@ -112,7 +112,7 @@ function computeSuggestions(
} }
return items.filter(profile => { return items.filter(profile => {
const mod = moderateProfile(profile, moderationOpts) const mod = moderateProfile(profile, moderationOpts)
return !mod.account.filter return !mod.account.filter && mod.account.cause?.type !== 'muted'
}) })
} }

View File

@ -180,6 +180,7 @@ export function ListMembers({
profile={(item as AppBskyGraphDefs.ListItemView).subject} profile={(item as AppBskyGraphDefs.ListItemView).subject}
renderButton={renderMemberButton} renderButton={renderMemberButton}
style={{paddingHorizontal: isMobile ? 8 : 14, paddingVertical: 4}} style={{paddingHorizontal: isMobile ? 8 : 14, paddingVertical: 4}}
noModFilter
/> />
) )
}, },

View File

@ -27,6 +27,7 @@ import {useSession} from '#/state/session'
export function ProfileCard({ export function ProfileCard({
testID, testID,
profile: profileUnshadowed, profile: profileUnshadowed,
noModFilter,
noBg, noBg,
noBorder, noBorder,
followers, followers,
@ -35,6 +36,7 @@ export function ProfileCard({
}: { }: {
testID?: string testID?: string
profile: AppBskyActorDefs.ProfileViewBasic profile: AppBskyActorDefs.ProfileViewBasic
noModFilter?: boolean
noBg?: boolean noBg?: boolean
noBorder?: boolean noBorder?: boolean
followers?: AppBskyActorDefs.ProfileView[] | undefined followers?: AppBskyActorDefs.ProfileView[] | undefined
@ -50,7 +52,11 @@ export function ProfileCard({
return null return null
} }
const moderation = moderateProfile(profile, moderationOpts) const moderation = moderateProfile(profile, moderationOpts)
if (moderation.account.filter) { if (
!noModFilter &&
moderation.account.filter &&
moderation.account.cause?.type !== 'muted'
) {
return null return null
} }

View File

@ -92,6 +92,7 @@ export function ModerationBlockedAccounts({}: Props) {
testID={`blockedAccount-${index}`} testID={`blockedAccount-${index}`}
key={item.did} key={item.did}
profile={item} profile={item}
noModFilter
/> />
) )
return ( return (

View File

@ -92,6 +92,7 @@ export function ModerationMutedAccounts({}: Props) {
testID={`mutedAccount-${index}`} testID={`mutedAccount-${index}`}
key={item.did} key={item.did}
profile={item} profile={item}
noModFilter
/> />
) )
return ( return (