Skip to content

Commit

Permalink
fix type check issues and setting of rollover enabled 🙄
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Oct 16, 2020
1 parent eab1538 commit a8ab7b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export const MinAgeInput = <Phase extends PhaseWithMinAge>({
<EuiFieldNumber
id={`${phase}-${selectedMinimumAgeProperty}`}
value={phaseData.selectedMinimumAge}
onChange={async (e) => {
onChange={(e) => {
setPhaseData(selectedMinimumAgeProperty, e.target.value);
}}
min={0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { Fragment, FunctionComponent } from 'react';
import React, { Fragment, FunctionComponent, useEffect } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import {
EuiFlexGroup,
EuiFlexItem,
EuiSpacer,
EuiFieldNumber,
EuiSwitch,
EuiFormRow,
EuiDescribedFormGroup,
EuiCallOut,
} from '@elastic/eui';
Expand Down Expand Up @@ -136,6 +134,10 @@ export const HotPhase: FunctionComponent<{ setWarmPhaseOnRollover: (v: boolean)
const form = useFormContext();
const isShowingErrors = form.isValid === false;

useEffect(() => {
setWarmPhaseOnRollover(isRolloverEnabled);
}, [setWarmPhaseOnRollover, isRolloverEnabled]);

return (
<>
<EuiDescribedFormGroup
Expand Down

0 comments on commit a8ab7b6

Please sign in to comment.