Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix two same emails display for user without display name #21779

Merged
merged 2 commits into from
Jun 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/components/MentionSuggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function MentionSuggestions(props) {
const renderSuggestionMenuItem = (item) => {
const isIcon = item.text === CONST.AUTO_COMPLETE_SUGGESTER.HERE_TEXT;
const styledDisplayName = getStyledTextArray(item.text, props.prefix);
const styledHandle = getStyledTextArray(item.alternateText, props.prefix);
const styledHandle = item.text === item.alternateText ? '' : getStyledTextArray(item.alternateText, props.prefix);

return (
<View style={[styles.autoCompleteSuggestionContainer, styles.ph2]}>
Expand Down Expand Up @@ -95,14 +95,18 @@ function MentionSuggestions(props) {
style={[styles.mentionSuggestionsText, styles.flex1]}
numberOfLines={1}
>
{_.map(styledHandle, ({text, isColored}, i) => (
<Text
key={`${text}${i}`}
style={[StyleUtils.getColoredBackgroundStyle(isColored), styles.mentionSuggestionsHandle, {...(isColored && {color: styles.text})}]}
>
{text}
</Text>
))}
{_.map(
styledHandle,
({text, isColored}, i) =>
text !== '' && (
<Text
key={`${text}${i}`}
style={[StyleUtils.getColoredBackgroundStyle(isColored), styles.mentionSuggestionsHandle, {...(isColored && {color: styles.text})}]}
>
{text}
</Text>
),
)}
</Text>
</View>
);
Expand Down