Skip to content

Commit

Permalink
Merge pull request #32437 from esh-g/distance-transaction-deep-merge
Browse files Browse the repository at this point in the history
Deep merge transaction for Distance request
  • Loading branch information
arosiclair authored Dec 26, 2023
2 parents e21cbb5 + 4a84e14 commit 433bc47
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Str from 'expensify-common/lib/str';
import lodashGet from 'lodash/get';
import lodashHas from 'lodash/has';
import Onyx from 'react-native-onyx';
import OnyxUtils from 'react-native-onyx/lib/utils';
import _ from 'underscore';
import ReceiptGeneric from '@assets/images/receipt-generic.png';
import * as API from '@libs/API';
Expand Down Expand Up @@ -681,11 +682,7 @@ function getMoneyRequestInformation(
// to remind me to do this.
const existingTransaction = allTransactionDrafts[`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${CONST.IOU.OPTIMISTIC_TRANSACTION_ID}`];
if (existingTransaction && existingTransaction.iouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE) {
optimisticTransaction = {
...optimisticTransaction,
...existingTransaction,
transactionID: optimisticTransaction.transactionID,
};
optimisticTransaction = OnyxUtils.fastMerge(existingTransaction, optimisticTransaction);
}

// STEP 4: Build optimistic reportActions. We need:
Expand Down

0 comments on commit 433bc47

Please sign in to comment.