feat: workflow remove preview mode (#3941)

This commit is contained in:
zxhlyh
2024-04-28 17:09:56 +08:00
committed by GitHub
parent 0940f01634
commit 8e4989ed03
33 changed files with 549 additions and 309 deletions

View File

@@ -81,6 +81,8 @@ export const useNodesSyncDraft = () => {
}, [store, featuresStore, workflowStore])
const syncWorkflowDraftWhenPageClose = useCallback(() => {
if (getNodesReadOnly())
return
const postParams = getPostParams()
if (postParams) {
@@ -89,16 +91,18 @@ export const useNodesSyncDraft = () => {
JSON.stringify(postParams.params),
)
}
}, [getPostParams, params.appId])
}, [getPostParams, params.appId, getNodesReadOnly])
const doSyncWorkflowDraft = useCallback(async (appId?: string) => {
if (getNodesReadOnly())
return
const postParams = getPostParams(appId)
if (postParams) {
const res = await syncWorkflowDraft(postParams)
workflowStore.getState().setDraftUpdatedAt(res.updated_at)
}
}, [workflowStore, getPostParams])
}, [workflowStore, getPostParams, getNodesReadOnly])
const handleSyncWorkflowDraft = useCallback((sync?: boolean, appId?: string) => {
if (getNodesReadOnly())