Skip to content

Commit

Permalink
Merge pull request #31659 from Expensify/puneet-displayname-group
Browse files Browse the repository at this point in the history
Set displayName fallback for group chat members page

(cherry picked from commit 981173c)
  • Loading branch information
pecanoro authored and OSBotify committed Nov 21, 2023
1 parent c4ffa24 commit c220949
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pages/ReportParticipantsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import withLocalize, {withLocalizePropTypes} from '@components/withLocalize';
import compose from '@libs/compose';
import * as LocalePhoneNumber from '@libs/LocalePhoneNumber';
import Navigation from '@libs/Navigation/Navigation';
import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils';
import * as ReportUtils from '@libs/ReportUtils';
import * as UserUtils from '@libs/UserUtils';
import useThemeStyles from '@styles/useThemeStyles';
Expand Down Expand Up @@ -59,10 +60,11 @@ const getAllParticipants = (report, personalDetails, translate) =>
.map((accountID, index) => {
const userPersonalDetail = lodashGet(personalDetails, accountID, {displayName: personalDetails.displayName || translate('common.hidden'), avatar: ''});
const userLogin = LocalePhoneNumber.formatPhoneNumber(userPersonalDetail.login || '') || translate('common.hidden');
const displayName = PersonalDetailsUtils.getDisplayNameOrDefault(userPersonalDetail, 'displayName');

return {
alternateText: userLogin,
displayName: userPersonalDetail.displayName,
displayName,
accountID: userPersonalDetail.accountID,
icons: [
{
Expand All @@ -74,9 +76,9 @@ const getAllParticipants = (report, personalDetails, translate) =>
],
keyForList: `${index}-${userLogin}`,
login: userLogin,
text: userPersonalDetail.displayName,
text: displayName,
tooltipText: userLogin,
participantsList: [{accountID, displayName: userPersonalDetail.displayName}],
participantsList: [{accountID, displayName}],
};
})
.sortBy((participant) => participant.displayName.toLowerCase())
Expand Down

0 comments on commit c220949

Please sign in to comment.