From 4fa0ba0c31e985c7f5200cc42f2d8452d2664a03 Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 29 Sep 2023 00:54:29 +0700 Subject: [PATCH 1/2] fix: regression infinite loading in request money page --- src/libs/actions/IOU.js | 18 ------------------ src/pages/iou/steps/NewRequestAmountPage.js | 4 ---- 2 files changed, 22 deletions(-) diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index 198ceb2b8172..152f285c84af 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -75,29 +75,11 @@ Onyx.connect({ }, }); -let didInitCurrency = false; -Onyx.connect({ - key: ONYXKEYS.IOU, - callback: (val) => { - didInitCurrency = lodashGet(val, 'didInitCurrency'); - }, -}); - -let shouldResetIOUAfterLogin = true; let currentUserPersonalDetails = {}; Onyx.connect({ key: ONYXKEYS.PERSONAL_DETAILS_LIST, callback: (val) => { currentUserPersonalDetails = lodashGet(val, userAccountID, {}); - if (!val || !shouldResetIOUAfterLogin || didInitCurrency) { - return; - } - // eslint-disable-next-line no-use-before-define - resetMoneyRequestInfo(); - shouldResetIOUAfterLogin = false; - Onyx.merge(ONYXKEYS.IOU, { - didInitCurrency: true, - }); }, }); diff --git a/src/pages/iou/steps/NewRequestAmountPage.js b/src/pages/iou/steps/NewRequestAmountPage.js index c9e2ca464303..6af84bc3026f 100644 --- a/src/pages/iou/steps/NewRequestAmountPage.js +++ b/src/pages/iou/steps/NewRequestAmountPage.js @@ -161,10 +161,6 @@ function NewRequestAmountPage({route, iou, report, selectedTab}) { /> ); - if (!lodashGet(iou, 'didInitCurrency', false)) { - return ; - } - // ScreenWrapper is only needed in edit mode because we have a dedicated route for the edit amount page (MoneyRequestEditAmountPage). // The rest of the cases this component is rendered through which has it's own ScreenWrapper if (!isEditing) { From e8d29e2376cdd3dba93e12b41948f5d32ab7445b Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 29 Sep 2023 01:06:39 +0700 Subject: [PATCH 2/2] fix lint --- src/pages/iou/steps/NewRequestAmountPage.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/iou/steps/NewRequestAmountPage.js b/src/pages/iou/steps/NewRequestAmountPage.js index 6af84bc3026f..ae319f5a73bb 100644 --- a/src/pages/iou/steps/NewRequestAmountPage.js +++ b/src/pages/iou/steps/NewRequestAmountPage.js @@ -22,7 +22,6 @@ import HeaderWithBackButton from '../../../components/HeaderWithBackButton'; import ScreenWrapper from '../../../components/ScreenWrapper'; import {iouPropTypes, iouDefaultProps} from '../propTypes'; import CONST from '../../../CONST'; -import FullScreenLoadingIndicator from '../../../components/FullscreenLoadingIndicator'; const propTypes = { /** React Navigation route */