From be2fa68a9a334a4fb6ec677c99dc79925e3f6036 Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Thu, 14 Sep 2023 17:02:05 +0300 Subject: [PATCH] fix: Variant type number duplicate options (#4719) Fixes a bug where the `number` option was shown multiple times --------- Signed-off-by: andreas-unleash --- .../EnvironmentVariantsModal/VariantForm/VariantForm.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 3a61919c17..c3af0edddd 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 @@ -199,7 +199,10 @@ export const VariantForm = ({ const variantTypeNumber = useUiFlag('variantTypeNumber'); useEffect(() => { - if (variantTypeNumber) { + if ( + variantTypeNumber && + !payloadOptions.some(option => option.key === 'number') + ) { payloadOptions.push({ key: 'number', label: 'number' }); } }, [variantTypeNumber]);