From 302ff9cc6ae915d557d21628f5bbda901537f2ad Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Wed, 5 Jun 2024 18:36:17 -0300 Subject: [PATCH] Refactor: Update IOModal to handle missing session IDs in flow_sessions --- src/frontend/src/modals/IOModal/index.tsx | 26 ++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/modals/IOModal/index.tsx b/src/frontend/src/modals/IOModal/index.tsx index 2bac1f2cb..cbb8cb0de 100644 --- a/src/frontend/src/modals/IOModal/index.tsx +++ b/src/frontend/src/modals/IOModal/index.tsx @@ -113,9 +113,15 @@ export default function IOModal({ setSelectedTab(inputs.length > 0 ? 1 : outputs.length > 0 ? 2 : 0); }, [allNodes.length]); - const flow_sessions = allNodes - .map((node) => (node.data as NodeDataType).node?.template["session_id"]) - .filter((session) => session !== undefined); + const flow_sessions = allNodes.map((node) => { + if ((node.data as NodeDataType).node?.template["session_id"]) { + return { + id: node.id, + session_id: (node.data as NodeDataType).node?.template["session_id"] + .value, + }; + } + }); useEffect(() => { setSelectedViewField(startView()); @@ -311,8 +317,18 @@ export default function IOModal({
- -
+ +
+ f_session?.session_id === session, + ) + ? "bg-status-green" + : "bg-slate-500", + )} + >