From bcda4de383e493f0570293f078a3bf8682ff8721 Mon Sep 17 00:00:00 2001 From: Vit Horacek <36083550+mountiny@users.noreply.github.com> Date: Wed, 3 Apr 2024 21:23:47 +0100 Subject: [PATCH] Merge pull request #39499 from Expensify/vit-fix39490 [CP Staging] Filter out also Send money actions in the one expense view (cherry picked from commit 0ba4099cd204cef18b5a3126b29a5657b03bea48) --- src/pages/home/report/ReportActionsView.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/home/report/ReportActionsView.tsx b/src/pages/home/report/ReportActionsView.tsx index 1c00ebce0579..88316d4e95f8 100755 --- a/src/pages/home/report/ReportActionsView.tsx +++ b/src/pages/home/report/ReportActionsView.tsx @@ -154,10 +154,11 @@ function ReportActionsView({ // Filter out the created action from the transaction thread report actions, since we already have the parent report's created action in `reportActions` const filteredTransactionThreadReportActions = transactionThreadReportActions?.filter((action) => action.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED); - // Filter out "created" IOU report actions because we don't want to show any preview actions for one transaction reports - const filteredReportActions = [...allReportActions, ...filteredTransactionThreadReportActions].filter( - (action) => ((action as OnyxTypes.OriginalMessageIOU).originalMessage?.type ?? '') !== CONST.IOU.REPORT_ACTION_TYPE.CREATE, - ); + // Filter out request and send money request actions because we don't want to show any preview actions for one transaction reports + const filteredReportActions = [...allReportActions, ...filteredTransactionThreadReportActions].filter((action) => { + const actionType = (action as OnyxTypes.OriginalMessageIOU).originalMessage?.type ?? ''; + return actionType !== CONST.IOU.REPORT_ACTION_TYPE.CREATE && !ReportActionsUtils.isSentMoneyReportAction(action); + }); return ReportActionsUtils.getSortedReportActions(filteredReportActions, true); }, [allReportActions, transactionThreadReportActions]);