1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: Variant type number duplicate options (#4719)

Fixes a bug where the `number` option was shown multiple times

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
andreas-unleash 2023-09-14 17:02:05 +03:00 committed by GitHub
parent c5791ab473
commit be2fa68a9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]);