From fd819cf8ca5e3e4192b3df85da9fb45978cc80da Mon Sep 17 00:00:00 2001 From: theborakompanioni Date: Sat, 2 May 2026 00:22:51 +0200 Subject: [PATCH] fix: maxCjFeeRelInPercent validation --- src/components/settings/fees/CollaboratorFeesForm.schema.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/settings/fees/CollaboratorFeesForm.schema.ts b/src/components/settings/fees/CollaboratorFeesForm.schema.ts index 25d76ce8..6732cf0d 100644 --- a/src/components/settings/fees/CollaboratorFeesForm.schema.ts +++ b/src/components/settings/fees/CollaboratorFeesForm.schema.ts @@ -1,7 +1,7 @@ import type { TFunction } from 'i18next' import * as yup from 'yup' import { CJ_FEE_ABS_MAX, CJ_FEE_ABS_MIN, CJ_FEE_REL_MAX, CJ_FEE_REL_MIN } from '@/constants/jam' -import { factorToPercentage, formatSats, isValidInteger } from '@/lib/utils' +import { factorToPercentage, formatSats, isValidInteger, isValidNumber } from '@/lib/utils' import type { AmountSats } from '@/types/global' export type CollaboratorFeesFormValues = { @@ -34,7 +34,7 @@ export function createCollaboratorFeesFormSchema({ .required(maxCjFeeAbsoluteMessage), maxCjFeeRelInPercent: yup .number() - .transform((value) => (isValidInteger(value) ? value : null)) + .transform((value) => (isValidNumber(value) ? value : null)) .min(factorToPercentage(CJ_FEE_REL_MIN), maxCjFeeRelativeMessage) .max(factorToPercentage(CJ_FEE_REL_MAX), maxCjFeeRelativeMessage) .required(maxCjFeeRelativeMessage),