fix: do not update step on initial render
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
bb3183959e
commit
3925de13a7
@@ -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]);
|
||||
|
||||
|
Reference in New Issue
Block a user