Skip to content

Commit

Permalink
Merge pull request #39499 from Expensify/vit-fix39490
Browse files Browse the repository at this point in the history
[CP Staging] Filter out also Send money actions in the one expense view
  • Loading branch information
mountiny authored Apr 3, 2024
2 parents 6e6489f + 9f2081a commit 0ba4099
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pages/home/report/ReportActionsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,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]);

Expand Down

0 comments on commit 0ba4099

Please sign in to comment.