Skip to content

Commit

Permalink
add save workflow calls when adges are added, smaller time intervals
Browse files Browse the repository at this point in the history
  • Loading branch information
mwdchang committed Sep 11, 2024
1 parent 5e5ac88 commit 58b3016
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,12 @@ const _saveWorkflow = async () => {
const _updateWorkflow = (event: any) => {
if (event.data.id !== wf.value.getId()) return;
console.log('update workflow', event.data);
// console.log('update workflow', event.data);
wf.value.update(event.data as Workflow);
};
const saveWorkflowHandler = debounce(_saveWorkflow, 400);
const updateWorkflowHandler = debounce(_updateWorkflow, 400);
const updateWorkflowHandler = debounce(_updateWorkflow, 250);
function appendInputPort(node: WorkflowNode<any>, port: { type: string; label?: string; value: any }) {
node.inputs.push({
Expand Down Expand Up @@ -515,6 +515,8 @@ async function onMenuSelection(operatorType: string, menuNode: WorkflowNode<any>
{ x: currentPortPosition.x, y: currentPortPosition.y },
{ x: currentPortPosition.x, y: currentPortPosition.y }
]);
saveWorkflowHandler();
}
}
Expand Down Expand Up @@ -698,6 +700,7 @@ function createNewEdge(node: WorkflowNode<any>, port: WorkflowPort, direction: W
newEdge.value!.points
);
cancelNewEdge();
saveWorkflowHandler();
}
}
Expand Down

0 comments on commit 58b3016

Please sign in to comment.