Skip to content

Commit

Permalink
Merge pull request #50424 from Expensify/georgia-expenseIcon
Browse files Browse the repository at this point in the history
[Expense ReportPreview Avatar] Update report preview avatar to use owner
  • Loading branch information
stitesExpensify authored Oct 16, 2024
2 parents d1d2264 + 81fe391 commit 0b3569a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pages/home/report/ReportActionItemSingle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,19 @@ function ReportActionItemSingle({
let actorHint = (login || (displayName ?? '')).replace(CONST.REGEX.MERGED_ACCOUNT_PREFIX, '');
const isTripRoom = ReportUtils.isTripRoom(report);
const isReportPreviewAction = action?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW;
const displayAllActors = isReportPreviewAction && !isTripRoom;
const displayAllActors = isReportPreviewAction && !isTripRoom && !ReportUtils.isPolicyExpenseChat(report);
const isInvoiceReport = ReportUtils.isInvoiceReport(iouReport ?? null);
const isWorkspaceActor = isInvoiceReport || (ReportUtils.isPolicyExpenseChat(report) && (!actorAccountID || displayAllActors));
const ownerAccountID = iouReport?.ownerAccountID ?? action?.childOwnerAccountID;
let avatarSource = avatar;
let avatarId: number | string | undefined = actorAccountID;

if (isReportPreviewAction && ReportUtils.isPolicyExpenseChat(report)) {
avatarId = ownerAccountID;
avatarSource = personalDetails[ownerAccountID ?? -1]?.avatar;
displayName = ReportUtils.getDisplayNameForParticipant(ownerAccountID);
actorHint = displayName;
}
if (isWorkspaceActor) {
displayName = ReportUtils.getPolicyName(report, undefined, policy);
actorHint = displayName;
Expand Down

0 comments on commit 0b3569a

Please sign in to comment.