From 9920870d0c8e9e2e9fa0e6f5ede28c18bc46b6f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 25 Oct 2023 18:05:34 -0600 Subject: [PATCH] Merge pull request #30403 from Expensify/revert-29654-28707-fix-amount-change-to-zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert "Amount changing to zero when editing it by going back in spliā€¦ (cherry picked from commit 9aa048c5b37795a95d91fe529b114692e9ff0063) --- src/libs/actions/IOU.js | 2 +- src/pages/iou/steps/MoneyRequestConfirmPage.js | 2 +- .../MoneyRequestParticipantsPage.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index 5e682dfb176f..6afdba5348f9 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -2887,7 +2887,7 @@ function setUpDistanceTransaction() { */ function navigateToNextPage(iou, iouType, report, path = '') { const moneyRequestID = `${iouType}${report.reportID || ''}`; - const shouldReset = !_.isEmpty(report.reportID) && iou.id !== moneyRequestID; + const shouldReset = iou.id !== moneyRequestID; // If the money request ID in Onyx does not match the ID from params, we want to start a new request // with the ID from params. We need to clear the participants in case the new request is initiated from FAB. diff --git a/src/pages/iou/steps/MoneyRequestConfirmPage.js b/src/pages/iou/steps/MoneyRequestConfirmPage.js index 96212d6f5a01..8b697cde4880 100644 --- a/src/pages/iou/steps/MoneyRequestConfirmPage.js +++ b/src/pages/iou/steps/MoneyRequestConfirmPage.js @@ -122,7 +122,7 @@ function MoneyRequestConfirmPage(props) { // Reset the money request Onyx if the ID in Onyx does not match the ID from params const moneyRequestId = `${iouType.current}${reportID.current}`; - const shouldReset = !isDistanceRequest && props.iou.id !== moneyRequestId && !_.isEmpty(reportID.current); + const shouldReset = !isDistanceRequest && props.iou.id !== moneyRequestId; if (shouldReset) { IOU.resetMoneyRequestInfo(moneyRequestId); } diff --git a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js index 60d11547d12c..4fff1cd310a3 100644 --- a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js +++ b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js @@ -80,7 +80,7 @@ function MoneyRequestParticipantsPage({iou, selectedTab, route}) { useEffect(() => { // ID in Onyx could change by initiating a new request in a separate browser tab or completing a request - if (prevMoneyRequestId.current !== iou.id && !_.isEmpty(reportID.current)) { + if (prevMoneyRequestId.current !== iou.id) { // The ID is cleared on completing a request. In that case, we will do nothing if (iou.id && !isDistanceRequest && !isSplitRequest) { navigateBack(true); @@ -90,7 +90,7 @@ function MoneyRequestParticipantsPage({iou, selectedTab, route}) { // Reset the money request Onyx if the ID in Onyx does not match the ID from params const moneyRequestId = `${iouType.current}${reportID.current}`; - const shouldReset = !_.isEmpty(reportID.current) && iou.id !== moneyRequestId; + const shouldReset = iou.id !== moneyRequestId; if (shouldReset) { IOU.resetMoneyRequestInfo(moneyRequestId); }