Skip to content

Commit

Permalink
Merge pull request #22848 from Expensify/yuwen-delegateDetails
Browse files Browse the repository at this point in the history
Make sure we have delegate details before displaying them in the case of a delegate action
  • Loading branch information
AndrewGable authored Jul 17, 2023
2 parents f638162 + c761435 commit 653ef72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/home/report/ReportActionItemSingle.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ function ReportActionItemSingle(props) {
displayName = ReportUtils.getPolicyName(props.report);
actorHint = displayName;
avatarSource = ReportUtils.getWorkspaceAvatar(props.report);
} else if (props.action.delegateAccountID) {
// We replace the actor's email, name, and avatar with the Copilot manually for now. This will be improved upon when
// the Copilot feature is implemented.
} else if (props.action.delegateAccountID && props.personalDetailsList[props.action.delegateAccountID]) {
// We replace the actor's email, name, and avatar with the Copilot manually for now. And only if we have their
// details. This will be improved upon when the Copilot feature is implemented.
const delegateDetails = props.personalDetailsList[props.action.delegateAccountID];
const delegateDisplayName = delegateDetails.displayName;
actorHint = `${delegateDisplayName} (${props.translate('reportAction.asCopilot')} ${displayName})`;
Expand Down

0 comments on commit 653ef72

Please sign in to comment.