Skip to content

Commit

Permalink
fix enabling of analyser item
Browse files Browse the repository at this point in the history
  • Loading branch information
MayGo committed Feb 17, 2020
1 parent e2cd65b commit b25e9b1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions client/src/components/Settings/AnalyserFormItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ export const AnalyserFormItem = ({ analyserItem, removeItem, appItems, saveItem
setShowTests(!showTests);
};

const [_ignore, { text, checkbox }] = useFormState(analyserItem, {
const [_ignore, { text, raw }] = useFormState(analyserItem, {
onChange: (__ignore, ___ignore, nextStateValues) => {
saveItem(nextStateValues);
},
});

const check = raw('enabled');

return (
<div>
<Flex justifyContent="space-between">
Expand All @@ -46,7 +48,12 @@ export const AnalyserFormItem = ({ analyserItem, removeItem, appItems, saveItem

<Form.Item>
Active
<Switch {...checkbox('enabled')} />
<Switch
onChange={value => {
check.onChange(value);
}}
checked={check.value}
/>
</Form.Item>
<Form.Item>
Test
Expand Down

0 comments on commit b25e9b1

Please sign in to comment.