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
  • Loading branch information
pecanoro authored Nov 21, 2023
2 parents 70638e6 + 429ec53 commit 981173c
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 981173c

Please sign in to comment.