Fixed chat priority on modal

This commit is contained in:
Lucas Oliveira 2024-03-31 21:59:32 +03:00
commit 9e04c86dab

View file

@ -32,6 +32,7 @@ export default function IOModal({
setOpen, setOpen,
disable, disable,
}: IOModalPropsType): JSX.Element { }: IOModalPropsType): JSX.Element {
const allNodes = useFlowStore((state) => state.nodes);
const inputs = useFlowStore((state) => state.inputs).filter( const inputs = useFlowStore((state) => state.inputs).filter(
(input) => input.type !== "ChatInput" (input) => input.type !== "ChatInput"
); );
@ -117,7 +118,7 @@ export default function IOModal({
useEffect(() => { useEffect(() => {
setSelectedViewField(startView()); setSelectedViewField(startView());
setSelectedTab(inputs.length > 0 ? 1 : outputs.length > 0 ? 2 : 0); setSelectedTab(inputs.length > 0 ? 1 : outputs.length > 0 ? 2 : 0);
}, [inputs.length, outputs.length, open]); }, [allNodes]);
return ( return (
<BaseModal <BaseModal