Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP Staging] Filter out also Send money actions in the one expense view #39499

Merged
merged 4 commits into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading