fix: debounce follower workflow sync requests in collaboration mode

This commit is contained in:
hjlarry 2026-04-12 20:22:06 +08:00
parent effe12cbee
commit d8e0b499df

View File

@ -1,7 +1,6 @@
import type { SyncDraftCallback } from '../hooks-store'
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'
@ -21,12 +20,6 @@ export const useNodesSyncDraft = () => {
if (getNodesReadOnly())
return
if (collaborationManager.isConnected() && !collaborationManager.getIsLeader()) {
if (sync)
collaborationManager.emitSyncRequest()
return
}
if (sync)
doSyncWorkflowDraft(notRefreshWhenSyncError, callback)
else