From 5647304db8045acfa6dccd824cc7f56ea5de0577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 25 Oct 2023 17:47:04 -0600 Subject: [PATCH] Revert "Amount changing to zero when editing it by going back in split bill workflow" --- 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 5e682dfb176f6..6afdba5348f96 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 96212d6f5a01b..8b697cde4880d 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 60d11547d12cf..4fff1cd310a3e 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); }