chore: workflow syncing modal (#5108)

This commit is contained in:
zxhlyh 2024-06-12 16:35:19 +08:00 • committed by GitHub
commit 95443bd551
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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 {