chat input validation removed
This commit is contained in:
parent
ad7e975310
commit
912dff60ec
2 changed files with 3 additions and 2 deletions
|
|
@ -34,7 +34,7 @@ export default function Chat({ reactFlowInstance }) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
function validateChatNodes(){
|
function validateChatNodes(){
|
||||||
if(!reactFlowInstance.getNodes().some((n)=> (n.type === 'chatOutputNode')) || !reactFlowInstance.getNodes().some((n)=> (n.type === 'chatInputNode'))){
|
if(!reactFlowInstance.getNodes().some((n)=> (n.type === 'chatOutputNode'))){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ export default function FlowPage({ flow }) {
|
||||||
const [edges, setEdges, onEdgesChange] = useEdgesState(
|
const [edges, setEdges, onEdgesChange] = useEdgesState(
|
||||||
flow.data?.edges ?? []
|
flow.data?.edges ?? []
|
||||||
);
|
);
|
||||||
|
const {setViewport} = useReactFlow()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (reactFlowInstance && flow) {
|
if (reactFlowInstance && flow) {
|
||||||
|
|
@ -64,7 +65,7 @@ export default function FlowPage({ flow }) {
|
||||||
setNodes(flow?.data?.nodes ?? []);
|
setNodes(flow?.data?.nodes ?? []);
|
||||||
setEdges(flow?.data?.edges ?? []);
|
setEdges(flow?.data?.edges ?? []);
|
||||||
if (reactFlowInstance) {
|
if (reactFlowInstance) {
|
||||||
reactFlowInstance.setViewport(
|
setViewport(
|
||||||
flow?.data?.viewport ?? { x: 1, y: 0, zoom: 1 }
|
flow?.data?.viewport ?? { x: 1, y: 0, zoom: 1 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue