Skip to content

Commit b7f3311

Browse files
committed
validate iouAmount for distance requests
1 parent 3da8f8c commit b7f3311

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/MoneyRequestConfirmationList.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,8 @@ function MoneyRequestConfirmationList(props) {
394394
Log.info(`[IOU] Sending money via: ${paymentMethod}`);
395395
onSendMoney(paymentMethod);
396396
} else {
397-
// validate the amount
398-
if (!isDistanceRequestWithoutRoute && !MoneyRequestUtils.validateAmount(formattedAmount)) {
397+
// validate the amount for distance requests
398+
if (props.isDistanceRequest && !isDistanceRequestWithoutRoute && !MoneyRequestUtils.validateAmount(String(props.iouAmount))) {
399399
setFormError('common.error.invalidAmount');
400400
return;
401401
}
@@ -404,7 +404,7 @@ function MoneyRequestConfirmationList(props) {
404404
onConfirm(selectedParticipants);
405405
}
406406
},
407-
[selectedParticipants, onSendMoney, onConfirm, props.iouType, isDistanceRequestWithoutRoute, formattedAmount],
407+
[selectedParticipants, onSendMoney, onConfirm, props.iouType, props.isDistanceRequest, isDistanceRequestWithoutRoute, props.iouAmount],
408408
);
409409

410410
const footerContent = useMemo(() => {

0 commit comments

Comments
 (0)