chore: workflow syncing modal (#5108)

This commit is contained in:
zxhlyh
2024-06-12 16:35:19 +08:00
committed by GitHub
parent 0ce97e6315
commit 95443bd551
8 changed files with 48 additions and 3 deletions

View File

@@ -57,11 +57,13 @@ export const useWorkflowUpdate = () => {
const {
appId,
setSyncWorkflowDraftHash,
setIsSyncingWorkflowDraft,
} = workflowStore.getState()
setIsSyncingWorkflowDraft(true)
fetchWorkflowDraft(`/apps/${appId}/workflows/draft`).then((response) => {
handleUpdateWorkflowCanvas(response.graph as WorkflowDataUpdator)
setSyncWorkflowDraftHash(response.hash)
})
}).finally(() => setIsSyncingWorkflowDraft(false))
}, [handleUpdateWorkflowCanvas, workflowStore])
return {