diff --git a/src/screens/Messages/Conversation/index.tsx b/src/screens/Messages/Conversation/index.tsx index 01c205ac..f382647a 100644 --- a/src/screens/Messages/Conversation/index.tsx +++ b/src/screens/Messages/Conversation/index.tsx @@ -147,6 +147,11 @@ let Header = ({ const navigation = useNavigation() const convoState = useConvo() + const isDeletedAccount = profile?.handle === 'missing.invalid' + const displayName = isDeletedAccount + ? 'Deleted Account' + : profile?.displayName + const onPressBack = useCallback(() => { if (isWeb) { navigation.replace('Messages') @@ -197,11 +202,13 @@ let Header = ({ - {profile.displayName} - - - @{profile.handle} + {displayName} + {!isDeletedAccount && ( + + @{profile.handle} + + )} ) : ( <> diff --git a/src/screens/Messages/List/ChatListItem.tsx b/src/screens/Messages/List/ChatListItem.tsx index f7d115ed..57a8e034 100644 --- a/src/screens/Messages/List/ChatListItem.tsx +++ b/src/screens/Messages/List/ChatListItem.tsx @@ -29,6 +29,13 @@ export function ChatListItem({ const {currentAccount} = useSession() const menuControl = useMenuControl() const {gtMobile} = useBreakpoints() + const otherUser = convo.members.find( + member => member.did !== currentAccount?.did, + ) + const isDeletedAccount = otherUser?.handle === 'missing.invalid' + const displayName = isDeletedAccount + ? 'Deleted Account' + : otherUser?.displayName || otherUser?.handle let lastMessage = _(msg`No messages yet`) let lastMessageSentAt: string | null = null @@ -44,10 +51,6 @@ export function ChatListItem({ lastMessage = _(msg`Message deleted`) } - const otherUser = convo.members.find( - member => member.did !== currentAccount?.did, - ) - const navigation = useNavigation() const [showActions, setShowActions] = React.useState(false) @@ -113,7 +116,7 @@ export function ChatListItem({ numberOfLines={1} style={[{maxWidth: '85%'}, web([a.leading_normal])]}> - {otherUser.displayName || otherUser.handle} + {displayName} {lastMessageSentAt && ( @@ -147,11 +150,13 @@ export function ChatListItem({ )} - - @{otherUser.handle} - + {!isDeletedAccount && ( + + @{otherUser.handle} + + )}