Skip to content

Commit

Permalink
Merge pull request #39433 from Expensify/nikki-iou-preview-bug
Browse files Browse the repository at this point in the history
[CP Staging] Ensure we don't show optimistic preview action for one-transaction reports
  • Loading branch information
mountiny authored Apr 2, 2024
2 parents ee5ab95 + 0d2a5aa commit 1f6e070
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/home/report/ReportActionsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ function ReportActionsView({
(action) => action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && action.originalMessage && action.originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.CREATE,
);

if (report.total && moneyRequestActions.length < (reportPreviewAction?.childMoneyRequestCount ?? 0)) {
if (report.total && moneyRequestActions.length < (reportPreviewAction?.childMoneyRequestCount ?? 0) && isEmptyObject(transactionThreadReport)) {
const optimisticIOUAction = ReportUtils.buildOptimisticIOUReportAction(
CONST.IOU.REPORT_ACTION_TYPE.CREATE,
0,
Expand Down Expand Up @@ -526,7 +526,7 @@ function ReportActionsView({
}

return [...actions, createdAction];
}, [reportActions, report]);
}, [reportActions, report, transactionThreadReport]);

// Comments have not loaded at all yet do nothing
if (!reportActions.length) {
Expand Down

0 comments on commit 1f6e070

Please sign in to comment.