From 66e49800c60d736642fa3877c7618e0688d4ed61 Mon Sep 17 00:00:00 2001 From: theborakompanioni Date: Mon, 11 Mar 2024 11:44:08 +0100 Subject: [PATCH] fix: allow absolute maker fee of zero --- src/components/Earn.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Earn.tsx b/src/components/Earn.tsx index 64b10007..772d3864 100644 --- a/src/components/Earn.tsx +++ b/src/components/Earn.tsx @@ -225,7 +225,7 @@ const EarnForm = ({ } if (isRelOffer) { - if (typeof values.feeRel !== 'number' || values.feeRel < feeRelMin || values.feeRel > feeRelMax) { + if (!isValidNumber(values.feeRel) || values.feeRel < feeRelMin || values.feeRel > feeRelMax) { errors.feeRel = t('earn.feedback_invalid_rel_fee', { feeRelPercentageMin: `${factorToPercentage(feeRelMin)}%`, feeRelPercentageMax: `${factorToPercentage(feeRelMax)}%`, @@ -234,7 +234,7 @@ const EarnForm = ({ } if (isAbsOffer) { - if (!isValidAmount(values.feeAbs?.value ?? null, false)) { + if (!isValidNumber(values.feeAbs?.value) || values.feeAbs!.value! < 0) { errors.feeAbs = t('earn.feedback_invalid_abs_fee') } }