Skip to content

Commit

Permalink
Set displayName fallback for group chat members page
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetlath committed Nov 21, 2023
1 parent 360fe05 commit 7579856
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 @@ -11,6 +11,7 @@ import ScreenWrapper from '@components/ScreenWrapper';
import withLocalize, {withLocalizePropTypes} from '@components/withLocalize';
import compose from '@libs/compose';
import * as LocalePhoneNumber from '@libs/LocalePhoneNumber';
import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils';
import Navigation from '@libs/Navigation/Navigation';
import * as ReportUtils from '@libs/ReportUtils';
import * as UserUtils from '@libs/UserUtils';
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 7579856

Please sign in to comment.