From caea8cd973754cad3c2e9eb5c4563bb2457d328b Mon Sep 17 00:00:00 2001 From: someone-here Date: Mon, 4 Dec 2023 22:07:04 +0530 Subject: [PATCH 1/3] Deep merge transaction for Distance request --- src/libs/actions/IOU.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index d9de984ad12c..5ebca731d37c 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -24,6 +24,7 @@ import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import * as Policy from './Policy'; import * as Report from './Report'; +import OnyxUtils from 'react-native-onyx/lib/utils'; let allPersonalDetails; Onyx.connect({ @@ -491,10 +492,7 @@ function getMoneyRequestInformation( // to remind me to do this. const existingTransaction = existingTransactionID && TransactionUtils.getTransaction(existingTransactionID); if (existingTransaction) { - optimisticTransaction = { - ...optimisticTransaction, - ...existingTransaction, - }; + optimisticTransaction = OnyxUtils.fastMerge(existingTransaction, optimisticTransaction); } // STEP 4: Build optimistic reportActions. We need: From 6e403d52a581d6da481212c7ac76a086504185dd Mon Sep 17 00:00:00 2001 From: someone-here Date: Mon, 4 Dec 2023 22:25:39 +0530 Subject: [PATCH 2/3] fix lint --- src/libs/actions/IOU.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index 5ebca731d37c..d6519c51df62 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -22,9 +22,9 @@ import * as UserUtils from '@libs/UserUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; +import OnyxUtils from 'react-native-onyx/lib/utils'; import * as Policy from './Policy'; import * as Report from './Report'; -import OnyxUtils from 'react-native-onyx/lib/utils'; let allPersonalDetails; Onyx.connect({ From 46a838d21fbd452381fa179597fde08085aa598c Mon Sep 17 00:00:00 2001 From: someone-here Date: Mon, 4 Dec 2023 22:30:10 +0530 Subject: [PATCH 3/3] fix lint --- src/libs/actions/IOU.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index d6519c51df62..338fb33730e9 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -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'; @@ -22,7 +23,6 @@ import * as UserUtils from '@libs/UserUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import OnyxUtils from 'react-native-onyx/lib/utils'; import * as Policy from './Policy'; import * as Report from './Report';