Skip to content

Commit

Permalink
Fix broken screen
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhenjaHorbach committed Feb 8, 2024
1 parent 29d39e3 commit 0445cff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/pages/iou/request/step/IOURequestStepCurrency.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function IOURequestStepCurrency({
});
}, [threadReportID]);

const navigateBack = () => {
const navigateBack = (selectedCurrency = undefined) => {
// If the currency selection was done from the confirmation step (eg. + > request money > manual > confirm > amount > currency)
// then the user needs taken back to the confirmation page instead of the initial amount page. This is because the route params
// are only able to handle one backTo param at a time and the user needs to go back to the amount page before going back
Expand All @@ -109,7 +109,7 @@ function IOURequestStepCurrency({
const confirmCurrencySelection = (option) => {
Keyboard.dismiss();
IOU.setMoneyRequestCurrency_temporaryForRefactor(transactionID, option.currencyCode);
navigateBack();
navigateBack(option.currencyCode);
};

const {sections, headerMessage, initiallyFocusedOptionKey} = useMemo(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/steps/NewRequestAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function NewRequestAmountPage({route, iou, report, selectedTab}) {
const textInput = useRef(null);

const iouType = lodashGet(route, 'params.iouType', '');
const reportID = lodashGet(route, 'params.reportID', '');
const reportID = lodashGet(route, 'params.reportID', '') || '0';
const transactionID = lodashGet(route, 'params.transactionID', CONST.IOU.OPTIMISTIC_TRANSACTION_ID);
const isEditing = Navigation.getActiveRoute().includes('amount');
const currentCurrency = lodashGet(route, 'params.currency', '');
Expand Down Expand Up @@ -127,7 +127,7 @@ function NewRequestAmountPage({route, iou, report, selectedTab}) {

// Remove query from the route and encode it.
const activeRoute = encodeURIComponent(Navigation.getActiveRouteWithoutParams());
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CURRENCY.getRoute(CONST.IOU.ACTION.CREATE, iouType, transactionID, reportID, '', activeRoute));
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CURRENCY.getRoute(CONST.IOU.ACTION.CREATE, iouType, transactionID, reportID, '0', activeRoute));
};

const navigateToNextPage = ({amount}) => {
Expand Down

0 comments on commit 0445cff

Please sign in to comment.