feat(trigger): update subscription list after saving draft

This commit is contained in:
yessenia
2025-10-15 16:51:36 +08:00
parent b07e80e6ae
commit 9aec255ee9
15 changed files with 118 additions and 1494 deletions

View File

@ -7,6 +7,12 @@ import {
} from './use-workflow'
import { useHooksStore } from '@/app/components/workflow/hooks-store'
export type SyncCallback = {
onSuccess?: () => void
onError?: () => void
onSettled?: () => void
}
export const useNodesSyncDraft = () => {
const { getNodesReadOnly } = useNodesReadOnly()
const debouncedSyncWorkflowDraft = useStore(s => s.debouncedSyncWorkflowDraft)
@ -16,11 +22,7 @@ export const useNodesSyncDraft = () => {
const handleSyncWorkflowDraft = useCallback((
sync?: boolean,
notRefreshWhenSyncError?: boolean,
callback?: {
onSuccess?: () => void
onError?: () => void
onSettled?: () => void
},
callback?: SyncCallback,
) => {
if (getNodesReadOnly())
return