fix: do not update step on initial render

This commit is contained in:
Ali BARIN
2022-01-28 16:17:23 +01:00
committed by Ömer Faruk Aydın
parent bb3183959e
commit 3925de13a7
3 changed files with 67 additions and 14 deletions

View File

@@ -50,10 +50,9 @@ export default function Editor(props: EditorProps): React.ReactElement {
const { flow } = props;
const onStepChange = React.useCallback((step: any) => {
const mutationInput = {
const mutationInput: Record<string, unknown> = {
id: step.id,
key: step.key,
appKey: step.appKey,
previousStepId: step.previousStepId,
connection: {
id: step.connection?.id
@@ -63,6 +62,10 @@ export default function Editor(props: EditorProps): React.ReactElement {
},
};
if (step.appKey) {
mutationInput.appKey = step.appKey;
}
updateStep({ variables: { input: mutationInput } });
}, [updateStep, flow.id]);