mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 11:56:55 +08:00
fix: debounce follower workflow sync requests in collaboration mode
This commit is contained in:
parent
effe12cbee
commit
d8e0b499df
@ -1,7 +1,6 @@
|
|||||||
import type { SyncDraftCallback } from '../hooks-store'
|
import type { SyncDraftCallback } from '../hooks-store'
|
||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
import { useHooksStore } from '@/app/components/workflow/hooks-store'
|
import { useHooksStore } from '@/app/components/workflow/hooks-store'
|
||||||
import { collaborationManager } from '../collaboration/core/collaboration-manager'
|
|
||||||
import { useStore } from '../store'
|
import { useStore } from '../store'
|
||||||
import { useNodesReadOnly } from './use-workflow'
|
import { useNodesReadOnly } from './use-workflow'
|
||||||
|
|
||||||
@ -21,12 +20,6 @@ export const useNodesSyncDraft = () => {
|
|||||||
if (getNodesReadOnly())
|
if (getNodesReadOnly())
|
||||||
return
|
return
|
||||||
|
|
||||||
if (collaborationManager.isConnected() && !collaborationManager.getIsLeader()) {
|
|
||||||
if (sync)
|
|
||||||
collaborationManager.emitSyncRequest()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sync)
|
if (sync)
|
||||||
doSyncWorkflowDraft(notRefreshWhenSyncError, callback)
|
doSyncWorkflowDraft(notRefreshWhenSyncError, callback)
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user