From 52e25bd63264d6ac69e3578e372392e4dd281f09 Mon Sep 17 00:00:00 2001 From: olav Date: Wed, 11 May 2022 09:44:22 +0200 Subject: [PATCH] fix: correct type for variant stickiness dropdown --- .../FeatureVariantsList/FeatureVariantsList.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/FeatureVariantsList.tsx b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/FeatureVariantsList.tsx index bba9a17650..8d3deca8b5 100644 --- a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/FeatureVariantsList.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/FeatureVariantsList.tsx @@ -42,7 +42,7 @@ const FeatureOverviewVariants = () => { const { patchFeatureVariants } = useFeatureApi(); const [editVariant, setEditVariant] = useState({}); const [showAddVariant, setShowAddVariant] = useState(false); - const [stickinessOptions, setStickinessOptions] = useState([]); + const [stickinessOptions, setStickinessOptions] = useState([]); const [delDialog, setDelDialog] = useState({ name: '', show: false }); useEffect(() => { @@ -58,7 +58,6 @@ const FeatureOverviewVariants = () => { ...context.filter(c => c.stickiness).map(c => c.name), ]; - // @ts-expect-error setStickinessOptions(options); }, [context]); @@ -102,15 +101,12 @@ const FeatureOverviewVariants = () => { const options = stickinessOptions.map(c => ({ key: c, label: c })); // guard on stickiness being disabled for context field. - // @ts-expect-error if (!stickinessOptions.includes(value)) { - // @ts-expect-error options.push({ key: value, label: value }); } - // @ts-expect-error - const onChange = event => { - updateStickiness(event.target.value); + const onChange = (value: string) => { + updateStickiness(value).catch(console.warn); }; return (