diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index df5b27635670c..30f8355260cdb 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -373,6 +373,14 @@ function shouldIgnoreGap(currentReportAction: ReportAction | undefined, nextRepo ); } +/** + * Returns filtered list for one transaction view as we don't want to display IOU action type in the one-transaction view + * Separated it from getCombinedReportActions, so it can be reused + */ +function getFilteredForOneTransactionView(reportActions: ReportAction[]): ReportAction[] { + return reportActions.filter((action) => !isSentMoneyReportAction(action)); +} + /** * Returns a sorted and filtered list of report actions from a report and it's associated child * transaction thread report in order to correctly display reportActions from both reports in the one-transaction report view. @@ -1462,6 +1470,7 @@ export { getTextFromHtml, isTripPreview, getIOUActionForReportID, + getFilteredForOneTransactionView, }; export type {LastVisibleMessage}; diff --git a/src/pages/home/report/ReportActionItemContentCreated.tsx b/src/pages/home/report/ReportActionItemContentCreated.tsx index a48d1d370db23..5cf247a201211 100644 --- a/src/pages/home/report/ReportActionItemContentCreated.tsx +++ b/src/pages/home/report/ReportActionItemContentCreated.tsx @@ -149,7 +149,7 @@ function ReportActionItemContentCreated({contextValue, parentReportAction, trans {transactionThreadReport && !isEmptyObject(transactionThreadReport) ? ( <> - {transactionCurrency !== report.currency && ( + {!!transaction && transactionCurrency !== report.currency && ( <>