Skip to content

Commit

Permalink
Merge pull request #27912 from hungvu193/fix-25819
Browse files Browse the repository at this point in the history
Fix duplicate participant name and avatar
  • Loading branch information
Hayata Suenaga authored Sep 26, 2023
2 parents f23241d + 67ed516 commit c6b7eae
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pages/home/report/ReportActionItemSingle.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,16 @@ function ReportActionItemSingle(props) {
let secondaryAvatar = {};
const primaryDisplayName = displayName;
if (displayAllActors) {
const secondaryUserDetails = props.personalDetailsList[props.iouReport.ownerAccountID] || {};
// The ownerAccountID and actorAccountID can be the same if the a user requests money back from the IOU's original creator, in that case we need to use managerID to avoid displaying the same user twice
const secondaryAccountId = props.iouReport.ownerAccountID === actorAccountID ? props.iouReport.managerID : props.iouReport.ownerAccountID;
const secondaryUserDetails = props.personalDetailsList[secondaryAccountId] || {};
const secondaryDisplayName = lodashGet(secondaryUserDetails, 'displayName', '');
displayName = `${primaryDisplayName} & ${secondaryDisplayName}`;
secondaryAvatar = {
source: UserUtils.getAvatar(secondaryUserDetails.avatar, props.iouReport.ownerAccountID),
source: UserUtils.getAvatar(secondaryUserDetails.avatar, secondaryAccountId),
type: CONST.ICON_TYPE_AVATAR,
name: secondaryDisplayName,
id: props.iouReport.ownerAccountID,
id: secondaryAccountId,
};
} else if (!isWorkspaceActor) {
secondaryAvatar = ReportUtils.getIcons(props.report, {})[props.report.isOwnPolicyExpenseChat ? 0 : 1];
Expand Down

0 comments on commit c6b7eae

Please sign in to comment.