From b7f33118634fb6e08098a77a1a5ae68d1094b02c Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 28 Sep 2023 19:04:01 +0100 Subject: [PATCH] validate iouAmount for distance requests --- src/components/MoneyRequestConfirmationList.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/MoneyRequestConfirmationList.js b/src/components/MoneyRequestConfirmationList.js index b1dc1c79f2c9..6000a247175c 100755 --- a/src/components/MoneyRequestConfirmationList.js +++ b/src/components/MoneyRequestConfirmationList.js @@ -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; } @@ -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(() => {