diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 9c03dd2af8fc..6681388c26dd 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -7889,6 +7889,8 @@ function putOnHold(transactionID: string, comment: string, reportID: string, sea const newViolation = {name: CONST.VIOLATIONS.HOLD, type: CONST.VIOLATION_TYPES.VIOLATION}; const transactionViolations = allTransactionViolations[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`] ?? []; const updatedViolations = [...transactionViolations, newViolation]; + const parentReportActionOptimistic = ReportUtils.getOptimisticDataForParentReportAction(reportID, createdReportActionComment.created, CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD); + const optimisticData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, @@ -7915,6 +7917,13 @@ function putOnHold(transactionID: string, comment: string, reportID: string, sea }, ]; + parentReportActionOptimistic.forEach((parentActionData) => { + if (!parentActionData) { + return; + } + optimisticData.push(parentActionData); + }); + const successData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE,