Skip to content

Commit

Permalink
Merge pull request #28410 from tienifr/fix/regression-24393-28280
Browse files Browse the repository at this point in the history
Fix: Regression - Infinite loading in request money page
  • Loading branch information
Gonals authored Oct 2, 2023
2 parents be18cb9 + a2f83b0 commit 9c15943
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
18 changes: 0 additions & 18 deletions src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
},
});

Expand Down
5 changes: 0 additions & 5 deletions src/pages/iou/steps/NewRequestAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -161,10 +160,6 @@ function NewRequestAmountPage({route, iou, report, selectedTab}) {
/>
);

if (!lodashGet(iou, 'didInitCurrency', false)) {
return <FullScreenLoadingIndicator />;
}

// 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 <MoneyRequestSelectorPage /> which has it's own ScreenWrapper
if (!isEditing) {
Expand Down

0 comments on commit 9c15943

Please sign in to comment.