Skip to content

Commit

Permalink
Merge pull request #45584 from bernhardoj/fix/45064-red-dot-remains-a…
Browse files Browse the repository at this point in the history
…fter-unhold

Fix red dot remains when unhold expense
  • Loading branch information
Beamanator authored Jul 17, 2024
2 parents ebe7d58 + b74a6b1 commit 1ca0bf7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7060,6 +7060,7 @@ function putOnHold(transactionID: string, comment: string, reportID: string) {
*/
function unholdRequest(transactionID: string, reportID: string) {
const createdReportAction = ReportUtils.buildOptimisticUnHoldReportAction();
const transactionViolations = allTransactionViolations[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`];

const optimisticData: OnyxUpdate[] = [
{
Expand All @@ -7079,6 +7080,11 @@ function unholdRequest(transactionID: string, reportID: string) {
},
},
},
{
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`,
value: transactionViolations?.filter((violation) => violation.name !== CONST.VIOLATIONS.HOLD) ?? [],
},
];

const successData: OnyxUpdate[] = [
Expand All @@ -7103,6 +7109,11 @@ function unholdRequest(transactionID: string, reportID: string) {
errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('iou.error.genericUnholdExpenseFailureMessage'),
},
},
{
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`,
value: transactionViolations ?? null,
},
];

API.write(
Expand Down

0 comments on commit 1ca0bf7

Please sign in to comment.