diff --git a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/VariantForm/VariantForm.tsx b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/VariantForm/VariantForm.tsx index fea165e547..3a61919c17 100644 --- a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/VariantForm/VariantForm.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/VariantForm/VariantForm.tsx @@ -262,7 +262,10 @@ export const VariantForm = ({ const validatePayload = (payload: IPayload) => { if (!isValidPayload(payload)) { - setError(ErrorField.PAYLOAD, 'Invalid JSON.'); + setError( + ErrorField.PAYLOAD, + payload.type === 'json' ? 'Invalid json' : 'Invalid number' + ); } }; @@ -293,7 +296,7 @@ export const VariantForm = ({ JSON.parse(payload.value); } if (variantTypeNumber && payload.type === 'number') { - Number(payload.value); + return !Number.isNaN(Number(payload.value)); } return true; } catch (e: unknown) {