new restore

This commit is contained in:
hjlarry
2026-01-23 14:22:58 +08:00
parent 51c8c50b82
commit e105dc6289
31 changed files with 361 additions and 18 deletions

View File

@ -1,5 +1,6 @@
import { useCallback } from 'react'
import { useHooksStore } from '@/app/components/workflow/hooks-store'
import { collaborationManager } from '../collaboration/core/collaboration-manager'
import { useStore } from '../store'
import { useNodesReadOnly } from './use-workflow'
@ -28,6 +29,12 @@ export const useNodesSyncDraft = () => {
if (getNodesReadOnly())
return
if (collaborationManager.isConnected() && !collaborationManager.getIsLeader()) {
if (sync)
collaborationManager.emitSyncRequest()
return
}
if (sync)
doSyncWorkflowDraft(notRefreshWhenSyncError, callback, forceUpload)
else