Skip to content

Commit

Permalink
Merge pull request Expensify#28685 from akinwale/task-27255-2
Browse files Browse the repository at this point in the history
fix: pass decimals parameter to validateAmount in MoneyRequestConfirmationList
  • Loading branch information
aldo-expensify authored Oct 3, 2023
2 parents c415f7b + dd46584 commit 74112a0
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 74112a0

Please sign in to comment.