Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

699 B
Raw Blame
import { produce } from 'immer'
import { useCallback } from 'react'
import { useWorkflowStore } from '@/app/components/workflow/store'
import { WorkflowRunningStatus } from '@/app/components/workflow/types'

export const useWorkflowPaused = () => {
  const workflowStore = useWorkflowStore()

  const handleWorkflowPaused = useCallback(() => {
    const { workflowRunningData, setWorkflowRunningData } = workflowStore.getState()

    setWorkflowRunningData(
      produce(workflowRunningData!, (draft) => {
        draft.result = {
          ...draft.result,
          status: WorkflowRunningStatus.Paused,
        }
      }),
    )
  }, [workflowStore])

  return {
    handleWorkflowPaused,
  }
}