Skip to content

Commit 868ab8d

Browse files
author
Keivan Vosoughi
committed
Test
1 parent 60072e3 commit 868ab8d

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

app/client/src/pages/DataGenerator/DataGenerator.tsx

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,6 @@ const DataGenerator: FunctionComponent<Props> = () => {
9393
if (generate_file_name && !mutation.data) {
9494
mutation.mutate(generate_file_name);
9595
}
96-
97-
if (mutation.data && mutation?.data?.dataset) {
98-
const dataset = mutation?.data?.dataset as any;
99-
form.setFieldsValue({
100-
...initialData,
101-
...dataset,
102-
workflow_type: dataset.technique === 'freeform' ?
103-
WorkflowType.FREE_FORM_DATA_GENERATION : WorkflowType.CUSTOM_DATA_GENERATION
104-
});
105-
}
106-
10796
}, [generate_file_name]);
10897

10998
useEffect(() => {
@@ -113,14 +102,15 @@ const DataGenerator: FunctionComponent<Props> = () => {
113102
...initialData,
114103
...(mutation?.data?.dataset as any)
115104
});
116-
form.setFieldsValue({
117-
...initialData,
118-
...(mutation?.data?.dataset as any)
119-
});
120-
formData.current = {
105+
const dataset = mutation?.data?.dataset as any;
106+
const values = {
121107
...initialData,
122-
...(mutation?.data?.dataset as any)
123-
};
108+
...dataset,
109+
workflow_type: dataset.technique === 'freeform' ?
110+
WorkflowType.FREE_FORM_DATA_GENERATION : WorkflowType.CUSTOM_DATA_GENERATION
111+
}
112+
form.setFieldsValue(values);
113+
formData.current = values;
124114
console.log('------> form', form.getFieldsValue());
125115
}
126116
}, [mutation.data]);

0 commit comments

Comments
 (0)