Skip to content

Commit

Permalink
validate iouAmount for distance requests
Browse files Browse the repository at this point in the history
  • Loading branch information
akinwale committed Sep 28, 2023
1 parent 3da8f8c commit b7f3311
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ function MoneyRequestConfirmationList(props) {
Log.info(`[IOU] Sending money via: ${paymentMethod}`);
onSendMoney(paymentMethod);
} else {
// validate the amount
if (!isDistanceRequestWithoutRoute && !MoneyRequestUtils.validateAmount(formattedAmount)) {
// validate the amount for distance requests
if (props.isDistanceRequest && !isDistanceRequestWithoutRoute && !MoneyRequestUtils.validateAmount(String(props.iouAmount))) {
setFormError('common.error.invalidAmount');
return;
}
Expand All @@ -404,7 +404,7 @@ function MoneyRequestConfirmationList(props) {
onConfirm(selectedParticipants);
}
},
[selectedParticipants, onSendMoney, onConfirm, props.iouType, isDistanceRequestWithoutRoute, formattedAmount],
[selectedParticipants, onSendMoney, onConfirm, props.iouType, props.isDistanceRequest, isDistanceRequestWithoutRoute, props.iouAmount],
);

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

0 comments on commit b7f3311

Please sign in to comment.