An ATproto social media client -- with an independent Appview.

filter out muted/blocked convos from share menu (#8802)

authored by samuel.fm and committed by

GitHub 3ce14b0c 9dfddd3c

+14 -2
+14 -2
src/components/PostControls/ShareMenu/RecentChats.tsx
··· 4 4 import {useLingui} from '@lingui/react' 5 5 import {useNavigation} from '@react-navigation/native' 6 6 7 + import {isBlockedOrBlocking, isMuted} from '#/lib/moderation/blocked-and-muted' 7 8 import {type NavigationProp} from '#/lib/routes/types' 8 9 import {sanitizeDisplayName} from '#/lib/strings/display-names' 9 10 import {sanitizeHandle} from '#/lib/strings/handles' 10 11 import {logger} from '#/logger' 12 + import {useProfileShadow} from '#/state/cache/profile-shadow' 11 13 import {useModerationOpts} from '#/state/preferences/moderation-opts' 12 14 import {useListConvosQuery} from '#/state/queries/messages/list-conversations' 13 15 import {useSession} from '#/state/session' ··· 57 59 member => member.did !== currentAccount?.did, 58 60 ) 59 61 60 - if (!otherMember || otherMember.handle === 'missing.invalid') 62 + if ( 63 + !otherMember || 64 + otherMember.handle === 'missing.invalid' || 65 + convo.muted 66 + ) 61 67 return null 62 68 63 69 return ( ··· 87 93 const WIDTH = 80 88 94 89 95 function RecentChatItem({ 90 - profile, 96 + profile: profileUnshadowed, 91 97 onPress, 92 98 moderationOpts, 93 99 }: { ··· 97 103 }) { 98 104 const {_} = useLingui() 99 105 const t = useTheme() 106 + 107 + const profile = useProfileShadow(profileUnshadowed) 100 108 101 109 const moderation = moderateProfile(profile, moderationOpts) 102 110 const name = sanitizeDisplayName( ··· 104 112 moderation.ui('displayName'), 105 113 ) 106 114 const verification = useSimpleVerificationState({profile}) 115 + 116 + if (isBlockedOrBlocking(profile) || isMuted(profile)) { 117 + return null 118 + } 107 119 108 120 return ( 109 121 <Button