From 42ea5c8e8edc605a214a06f3fb53941382a3d7f4 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Tue, 2 Apr 2024 02:24:03 +0200 Subject: [PATCH] Fixed IO Modal updates --- src/frontend/src/modals/IOModal/index.tsx | 40 ++++++++++++----------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/frontend/src/modals/IOModal/index.tsx b/src/frontend/src/modals/IOModal/index.tsx index 79bed0557..c81aecc35 100644 --- a/src/frontend/src/modals/IOModal/index.tsx +++ b/src/frontend/src/modals/IOModal/index.tsx @@ -59,13 +59,11 @@ export default function IOModal({ if (!chatInput && !chatOutput) { if (inputs.length > 0) { return inputs[0]; - } - else { + } else { return outputs[0]; } - } - else { - return undefined + } else { + return undefined; } } @@ -116,12 +114,12 @@ export default function IOModal({ } useEffect(() => { - if(selectedTab!==2) setSelectedTab(inputs.length > 0 ? 1 : outputs.length > 0 ? 2 : 0); - }, [allNodes]); + setSelectedTab(inputs.length > 0 ? 1 : outputs.length > 0 ? 2 : 0); + }, [allNodes.length]); useEffect(() => { setSelectedViewField(startView()); - },[open]) + }, [open]); return (
-
+
{selectedTab !== 0 && (
- {(haveChat && )} + {haveChat && ( + + )} { nodes.find((node) => node.id === selectedViewField.id) ?.data.node.display_name @@ -376,8 +376,8 @@ export default function IOModal({
- - {!haveChat && ( + {!haveChat ? ( +
- )} -
+
+ ) : ( + <> + )} ); }