diff --git a/src/pages/iou/steps/MoneyRequestAmountPage.js b/src/pages/iou/steps/MoneyRequestAmountPage.js index e25f7acb0553..fc27a7779041 100755 --- a/src/pages/iou/steps/MoneyRequestAmountPage.js +++ b/src/pages/iou/steps/MoneyRequestAmountPage.js @@ -178,7 +178,7 @@ function MoneyRequestAmountPage(props) { const isEditing = useRef(lodashGet(props.route, 'path', '').includes('amount')); const [amount, setAmount] = useState(selectedAmountAsString); - const [selectedCurrencyCode, setSelectedCurrencyCode] = useState(props.iou.currency); + const [selectedCurrencyCode, setSelectedCurrencyCode] = useState(props.iou.currency || CONST.CURRENCY.USD); const [shouldUpdateSelection, setShouldUpdateSelection] = useState(true); const [selection, setSelection] = useState({start: selectedAmountAsString.length, end: selectedAmountAsString.length}); @@ -276,16 +276,14 @@ function MoneyRequestAmountPage(props) { }, [props.iou.participants, props.iou.amount, props.iou.id]); useEffect(() => { - if (!props.route.params.currency) { + if (props.route.params.currency) { + setSelectedCurrencyCode(props.route.params.currency); return; } - - setSelectedCurrencyCode(props.route.params.currency); - }, [props.route.params.currency]); - - useEffect(() => { - setSelectedCurrencyCode(props.iou.currency); - }, [props.iou.currency]); + if (props.iou.currency) { + setSelectedCurrencyCode(props.iou.currency); + } + }, [props.route.params.currency, props.iou.currency]); useEffect(() => { saveAmountToState(props.iou.currency, props.iou.amount);