diff --git a/native/navigation/community-drawer-content.react.js b/native/navigation/community-drawer-content.react.js --- a/native/navigation/community-drawer-content.react.js +++ b/native/navigation/community-drawer-content.react.js @@ -10,7 +10,12 @@ communityThreadSelector, } from 'lib/selectors/thread-selectors'; import { threadIsChannel } from 'lib/shared/thread-utils'; -import { type ThreadInfo, communitySubthreads } from 'lib/types/thread-types'; +import { + type ThreadInfo, + type ResolvedThreadInfo, + communitySubthreads, +} from 'lib/types/thread-types'; +import { useResolvedThreadInfos } from 'lib/utils/entity-helpers'; import { useNavigateToThread } from '../chat/message-list-types'; import { useStyles } from '../themes/colors'; @@ -25,9 +30,11 @@ function CommunityDrawerContent(): React.Node { const communities = useSelector(communityThreadSelector); - const communitiesSuffixed = React.useMemo(() => appendSuffix(communities), [ - communities, - ]); + const resolvedCommunities = useResolvedThreadInfos(communities); + const communitiesSuffixed = React.useMemo( + () => appendSuffix(resolvedCommunities), + [resolvedCommunities], + ); const styles = useStyles(unboundStyles); const [openCommunity, setOpenCommunity] = React.useState( @@ -91,7 +98,7 @@ function createRecursiveDrawerItemsData( childThreadInfosMap: { +[id: string]: $ReadOnlyArray }, - communities: $ReadOnlyArray, + communities: $ReadOnlyArray, labelStyles: $ReadOnlyArray, ) { const result = communities.map(community => ({ @@ -138,7 +145,9 @@ ); } -function appendSuffix(chats: $ReadOnlyArray): ThreadInfo[] { +function appendSuffix( + chats: $ReadOnlyArray, +): ResolvedThreadInfo[] { const result = []; const names = new Map(); diff --git a/native/navigation/community-drawer-item.react.js b/native/navigation/community-drawer-item.react.js --- a/native/navigation/community-drawer-item.react.js +++ b/native/navigation/community-drawer-item.react.js @@ -4,6 +4,7 @@ import { View, FlatList, TouchableOpacity } from 'react-native'; import type { ThreadInfo } from 'lib/types/thread-types'; +import { useResolvedThreadInfo } from 'lib/utils/entity-helpers'; import type { MessageListParams } from '../chat/message-list-types'; import { SingleLine } from '../components/single-line.react'; @@ -83,6 +84,7 @@ navigateToThread({ threadInfo }); }, [navigateToThread, threadInfo]); + const { uiName } = useResolvedThreadInfo(threadInfo); return ( @@ -92,7 +94,7 @@ style={styles.textTouchableWrapper} onLongPress={onExpandToggled} > - {threadInfo.uiName} + {uiName} {children}