Skip to content

Commit

Permalink
Merge pull request #26102 from lukemorawski/25714-stop_using_report_p…
Browse files Browse the repository at this point in the history
…articipants

25714 stop using report participants
  • Loading branch information
puneetlath authored Sep 10, 2023
2 parents fd043aa + 544d97f commit 1400608
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ function isDM(report) {
* @returns {Boolean}
*/
function hasSingleParticipant(report) {
return report.participants && report.participants.length === 1;
return report.participantAccountIDs && report.participantAccountIDs.length === 1;
}

/**
Expand Down
5 changes: 4 additions & 1 deletion src/libs/actions/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,10 @@ function getShareDestination(reportID, reports, personalDetails) {
const report = lodashGet(reports, `report_${reportID}`, {});
let subtitle = '';
if (ReportUtils.isChatReport(report) && ReportUtils.isDM(report) && ReportUtils.hasSingleParticipant(report)) {
subtitle = LocalePhoneNumber.formatPhoneNumber(report.participants[0]);
const participantAccountID = lodashGet(report, 'participantAccountIDs[0]');
const displayName = lodashGet(personalDetails, [participantAccountID, 'displayName']);
const login = lodashGet(personalDetails, [participantAccountID, 'login']);
subtitle = LocalePhoneNumber.formatPhoneNumber(login || displayName);
} else {
subtitle = ReportUtils.getChatRoomSubtitle(report);
}
Expand Down

0 comments on commit 1400608

Please sign in to comment.