Skip to content

Commit

Permalink
Merge pull request #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
(cherry picked from commit 74112a0)
  • Loading branch information
aldo-expensify authored and OSBotify committed Oct 3, 2023
1 parent d8b42cd commit 13967d7
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 13967d7

Please sign in to comment.