mirror of
https://github.com/Unleash/unleash.git
synced 2025-03-14 00:15:52 +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:
parent
c5791ab473
commit
be2fa68a9a
@ -199,7 +199,10 @@ export const VariantForm = ({
|
|||||||
const variantTypeNumber = useUiFlag('variantTypeNumber');
|
const variantTypeNumber = useUiFlag('variantTypeNumber');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (variantTypeNumber) {
|
if (
|
||||||
|
variantTypeNumber &&
|
||||||
|
!payloadOptions.some(option => option.key === 'number')
|
||||||
|
) {
|
||||||
payloadOptions.push({ key: 'number', label: 'number' });
|
payloadOptions.push({ key: 'number', label: 'number' });
|
||||||
}
|
}
|
||||||
}, [variantTypeNumber]);
|
}, [variantTypeNumber]);
|
||||||
|
Loading…
Reference in New Issue
Block a user