mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-16 11:05:53 +08:00
chore: not find varId not update
This commit is contained in:
parent
edc6ab8722
commit
1db97556aa
@ -129,16 +129,25 @@ const useInspectVarsCrud = () => {
|
|||||||
handleCancelNodeSuccessStatus(nodeId)
|
handleCancelNodeSuccessStatus(nodeId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const hasNodeInspectVar = (nodeId: string, varId: string) => {
|
||||||
|
const targetNode = nodesWithInspectVars.find(item => item.nodeId === nodeId)
|
||||||
|
if(!targetNode || !targetNode.vars)
|
||||||
|
return false
|
||||||
|
return targetNode.vars.some(item => item.id === varId)
|
||||||
|
}
|
||||||
|
|
||||||
const deleteInspectVar = async (nodeId: string, varId: string) => {
|
const deleteInspectVar = async (nodeId: string, varId: string) => {
|
||||||
await doDeleteInspectVar(varId)
|
if(hasNodeInspectVar(nodeId, varId)) {
|
||||||
deleteInspectVarInStore(nodeId, varId)
|
await doDeleteInspectVar(varId)
|
||||||
|
deleteInspectVarInStore(nodeId, varId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteNodeInspectorVars = async (nodeId: string) => {
|
const deleteNodeInspectorVars = async (nodeId: string) => {
|
||||||
if (hasNodeInspectVars(nodeId))
|
if (hasNodeInspectVars(nodeId)) {
|
||||||
await doDeleteNodeInspectorVars(nodeId)
|
await doDeleteNodeInspectorVars(nodeId)
|
||||||
|
deleteNodeInspectVarsInStore(nodeId)
|
||||||
deleteNodeInspectVarsInStore(nodeId)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteAllInspectorVars = async () => {
|
const deleteAllInspectorVars = async () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user