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

Set displayName fallback for group chat members page #31659

Merged
merged 2 commits into from
Nov 21, 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
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
Loading