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.

617 B
Raw Blame
import { atom } from 'jotai'

export type DocumentBulkAction = 'availability' | 'download' | 'reindex' | 'remove'

export const documentBulkPendingActionAtom = atom<DocumentBulkAction | undefined>()

export const beginDocumentBulkActionAtom = atom(null, (get, set, action: DocumentBulkAction) => {
  if (get(documentBulkPendingActionAtom)) return false
  set(documentBulkPendingActionAtom, action)
  return true
})

export const finishDocumentBulkActionAtom = atom(null, (get, set, action: DocumentBulkAction) => {
  if (get(documentBulkPendingActionAtom) === action) set(documentBulkPendingActionAtom, undefined)
})