Skip to content

Commit 1a8323c

Browse files
committed
fix the bug that index field is not getting populated when editing a detector
Signed-off-by: Jackie Han <jkhanjob@gmail.com>
1 parent 086fc35 commit 1a8323c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

public/pages/DefineDetector/components/Datasource/DataSource.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,11 @@ export function DataSource(props: DataSourceProps) {
6161
const { setFieldValue } = useFormikContext();
6262

6363
useEffect(() => {
64-
setFieldValue('index', []);
65-
setFieldValue('timeField', undefined);
66-
setFieldValue('filters', []);
67-
6864
const getInitialIndices = async () => {
6965
await dispatch(getIndices(queryText, dataSourceId));
66+
setFieldValue('index', props.formikProps.values.index);
67+
setFieldValue('timeField', props.formikProps.values.timeField);
68+
setFieldValue('filters', props.formikProps.values.filters);
7069
};
7170
getInitialIndices();
7271
}, [dataSourceId]);

0 commit comments

Comments
 (0)