Skip to content

Commit

Permalink
pass decimals parameter to validateAmount
Browse files Browse the repository at this point in the history
  • Loading branch information
akinwale committed Oct 3, 2023
1 parent ee81a28 commit dd46584
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ function MoneyRequestConfirmationList(props) {
onSendMoney(paymentMethod);
} else {
// validate the amount for distance requests
if (props.isDistanceRequest && !isDistanceRequestWithoutRoute && !MoneyRequestUtils.validateAmount(String(props.iouAmount))) {
const decimals = CurrencyUtils.getCurrencyDecimals(props.iouCurrencyCode);
if (props.isDistanceRequest && !isDistanceRequestWithoutRoute && !MoneyRequestUtils.validateAmount(String(props.iouAmount), decimals)) {
setFormError('common.error.invalidAmount');
return;
}
Expand All @@ -404,7 +405,7 @@ function MoneyRequestConfirmationList(props) {
onConfirm(selectedParticipants);
}
},
[selectedParticipants, onSendMoney, onConfirm, props.iouType, props.isDistanceRequest, isDistanceRequestWithoutRoute, props.iouAmount],
[selectedParticipants, onSendMoney, onConfirm, props.iouType, props.isDistanceRequest, isDistanceRequestWithoutRoute, props.iouCurrencyCode, props.iouAmount],
);

const footerContent = useMemo(() => {
Expand Down

0 comments on commit dd46584

Please sign in to comment.