Skip to content

Commit

Permalink
Merge pull request Expensify#49866 from FitseTLT/fix-thread-reply-mis…
Browse files Browse the repository at this point in the history
…sing-for-hold-message-created

Fix - Expense-Thread message for hold expense not shown in offline
  • Loading branch information
Beamanator authored Oct 3, 2024
2 parents 91f610c + c31d837 commit 897da0e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 897da0e

Please sign in to comment.