Skip to content

Commit

Permalink
Merge pull request #37009 from paultsimura/fix/32263-pending-fields
Browse files Browse the repository at this point in the history
IOU: use cleared pending fields
  • Loading branch information
tgolen authored Feb 23, 2024
2 parents 895de29 + b09c0ea commit b80cd5a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ function buildOnyxDataForMoneyRequest(
): [OnyxUpdate[], OnyxUpdate[], OnyxUpdate[]] {
const isScanRequest = TransactionUtils.isScanRequest(transaction);
const outstandingChildRequest = getOutstandingChildRequest(needsToBeManuallySubmitted, policy);
const clearedPendingFields = Object.fromEntries(Object.keys(transaction.pendingFields ?? {}).map((key) => [key, null]));
const optimisticData: OnyxUpdate[] = [];

if (chatReport) {
Expand Down Expand Up @@ -535,7 +536,7 @@ function buildOnyxDataForMoneyRequest(
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transaction.transactionID}`,
value: {
pendingAction: null,
pendingFields: null,
pendingFields: clearedPendingFields,
},
},

Expand Down Expand Up @@ -610,7 +611,7 @@ function buildOnyxDataForMoneyRequest(
value: {
errors: ErrorUtils.getMicroSecondOnyxError('iou.error.genericCreateFailureMessage'),
pendingAction: null,
pendingFields: null,
pendingFields: clearedPendingFields,
},
},

Expand Down

0 comments on commit b80cd5a

Please sign in to comment.