diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index 9a02c16024ce..1e69bd236f0f 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -2936,11 +2936,6 @@ function approveMoneyRequest(expenseReport) { statusNum: CONST.REPORT.STATUS.APPROVED, }, }; - const optimisticNextStepsData = { - onyxMethod: Onyx.METHOD.SET, - key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`, - value: null, - }; const optimisticData = [optimisticIOUReportData, optimisticReportActionsData]; const successData = [ @@ -2968,7 +2963,11 @@ function approveMoneyRequest(expenseReport) { ]; if (!_.isNull(currentNextStep)) { - optimisticData.push(optimisticNextStepsData); + optimisticData.push({ + onyxMethod: Onyx.METHOD.SET, + key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`, + value: null, + }); failureData.push({ onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`,