fixed verification error
This commit is contained in:
parent
dc3a3dfa64
commit
40b3a9d6e3
2 changed files with 20 additions and 22 deletions
|
|
@ -75,24 +75,23 @@ export default function Chat({ flow, reactFlowInstance }: ChatType) {
|
||||||
}, [chatHistory]);
|
}, [chatHistory]);
|
||||||
function validateNodes() {
|
function validateNodes() {
|
||||||
if (
|
if (
|
||||||
reactFlowInstance
|
reactFlowInstance.getNodes().some(
|
||||||
.getNodes()
|
|
||||||
.some(
|
|
||||||
(n) =>
|
(n) =>
|
||||||
n.data.node &&
|
n.data.node &&
|
||||||
Object.keys(n.data.node.template).some(
|
Object.keys(n.data.node.template).some((t: any) => {
|
||||||
(t: any) =>
|
return (
|
||||||
n.data.node.template[t].required &&
|
|
||||||
n.data.node.template[t].value === "" &&
|
|
||||||
n.data.node.template[t].required &&
|
n.data.node.template[t].required &&
|
||||||
|
(!n.data.node.template[t].value ||
|
||||||
|
n.data.node.template[t].value === "") &&
|
||||||
!reactFlowInstance
|
!reactFlowInstance
|
||||||
.getEdges()
|
.getEdges()
|
||||||
.some(
|
.some(
|
||||||
(e) =>
|
(e) =>
|
||||||
e.sourceHandle.split("|")[1] === t &&
|
e.targetHandle.split("|")[1] === t &&
|
||||||
e.sourceHandle.split("|")[2] === n.id
|
e.targetHandle.split("|")[2] === n.id
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
);
|
||||||
|
})
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -133,7 +132,7 @@ export default function Chat({ flow, reactFlowInstance }: ChatType) {
|
||||||
lastMessage = newChat.pop().message;
|
lastMessage = newChat.pop().message;
|
||||||
return newChat;
|
return newChat;
|
||||||
});
|
});
|
||||||
setChatValue(lastMessage)
|
setChatValue(lastMessage);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setErrorData({
|
setErrorData({
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import {
|
||||||
ComputerDesktopIcon,
|
ComputerDesktopIcon,
|
||||||
Bars3CenterLeftIcon,
|
Bars3CenterLeftIcon,
|
||||||
GiftIcon,
|
GiftIcon,
|
||||||
PaperClipIcon,
|
|
||||||
QuestionMarkCircleIcon,
|
QuestionMarkCircleIcon,
|
||||||
} from "@heroicons/react/24/outline";
|
} from "@heroicons/react/24/outline";
|
||||||
import { Connection, Edge, Node, ReactFlowInstance } from "reactflow";
|
import { Connection, Edge, Node, ReactFlowInstance } from "reactflow";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue