From 81846715da04431e1b1095994fe402dc8acf8fec Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Thu, 3 Oct 2024 11:37:16 +0700 Subject: [PATCH 1/2] fix: Tapping thread reply of expense hold offline, hmm not here displayed briefly --- src/libs/ReportActionsUtils.ts | 2 +- src/libs/actions/IOU.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 486943494854..da4414ffcb23 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1068,7 +1068,7 @@ function getOneTransactionThreadReportID(reportID: string, reportActions: OnyxEn // If there's only one IOU request action associated with the report but it's been deleted, then we don't consider this a oneTransaction report // and want to display it using the standard view - if ((originalMessage?.deleted ?? '') !== '' && isMoneyRequestAction(singleAction)) { + if (((originalMessage?.deleted ?? '') !== '' || isDeletedAction(singleAction)) && isMoneyRequestAction(singleAction)) { return; } diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 9c03dd2af8fc..8adc13b493ac 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -7889,6 +7889,7 @@ 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 optimisticData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, @@ -7915,6 +7916,13 @@ function putOnHold(transactionID: string, comment: string, reportID: string, sea }, ]; + const optimisticParentReportActions = ReportUtils.getOptimisticDataForParentReportAction(reportID, currentTime, CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD); + optimisticParentReportActions.forEach((optimisticParentReportAction) => { + if (!optimisticParentReportAction) { + return; + } + optimisticData.push(optimisticParentReportAction); + }); const successData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, From 74fa5107a2f9d24daecc9b41c30c38aeb62ee3ca Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Thu, 3 Oct 2024 11:38:05 +0700 Subject: [PATCH 2/2] fix lint --- src/libs/actions/IOU.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 8adc13b493ac..04be8dffdd33 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -7889,7 +7889,6 @@ 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 optimisticData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE,