Skip to content

Commit

Permalink
Merge pull request #46266 from tienifr/fix/45344
Browse files Browse the repository at this point in the history
show trip name for trip room report preview action
  • Loading branch information
stitesExpensify authored Jul 26, 2024
2 parents e997502 + 9084ee1 commit 9d20e18
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/home/report/ReportActionItemSingle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ function ReportActionItemSingle({
const {avatar, login, pendingFields, status, fallbackIcon} = personalDetails[actorAccountID ?? -1] ?? {};
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
let actorHint = (login || (displayName ?? '')).replace(CONST.REGEX.MERGED_ACCOUNT_PREFIX, '');
const displayAllActors = useMemo(() => action?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW, [action?.actionName]);
const isTripRoom = ReportUtils.isTripRoom(report);
const isReportPreviewAction = action?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW;
const displayAllActors = isReportPreviewAction && !isTripRoom;
const isInvoiceReport = ReportUtils.isInvoiceReport(iouReport ?? null);
const isWorkspaceActor = isInvoiceReport || (ReportUtils.isPolicyExpenseChat(report) && (!actorAccountID || displayAllActors));
const ownerAccountID = iouReport?.ownerAccountID ?? action?.childOwnerAccountID;
Expand All @@ -106,6 +108,8 @@ function ReportActionItemSingle({
displayName = actorHint;
avatarSource = delegateDetails?.avatar;
avatarId = action.delegateAccountID;
} else if (isReportPreviewAction && isTripRoom) {
displayName = report?.reportName ?? '';
}

// If this is a report preview, display names and avatars of both people involved
Expand Down

0 comments on commit 9d20e18

Please sign in to comment.