MCPcopy
hub / github.com/FlowiseAI/Flowise / useConfirm

Function useConfirm

packages/ui/src/hooks/useConfirm.jsx:6–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5let resolveCallback
6const useConfirm = () => {
7 const [confirmState, dispatch] = useContext(ConfirmContext)
8
9 const closeConfirm = () => {
10 dispatch({
11 type: HIDE_CONFIRM
12 })
13 }
14
15 const onConfirm = () => {
16 closeConfirm()
17 resolveCallback(true)
18 }
19
20 const onCancel = () => {
21 closeConfirm()
22 resolveCallback(false)
23 }
24 const confirm = (confirmPayload) => {
25 dispatch({
26 type: SHOW_CONFIRM,
27 payload: confirmPayload
28 })
29 return new Promise((res) => {
30 resolveCallback = res
31 })
32 }
33
34 return { confirm, onConfirm, onCancel, confirmState }
35}
36
37export default useConfirm

Callers 15

UsersFunction · 0.85
ToolDialogFunction · 0.85
CustomMcpServerDialogFunction · 0.85
CredentialsFunction · 0.85
EvalEvaluationRowsFunction · 0.85
EvalsEvaluationFunction · 0.85
EvaluationRunRowFunction · 0.85
FilesFunction · 0.85
VariablesFunction · 0.85
CanvasFunction · 0.85
AgentflowCanvasFunction · 0.85
WorkspaceDetailsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected