From b47f6aa3265dafd420448941581f3aa6a1b813a2 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 16 Jun 2023 13:03:38 -0300 Subject: [PATCH] refactor(frontend): add isBuilding state to SSEContext and use it in GenericNode and BuildTrigger components The isBuilding state was added to the SSEContext to keep track of whether a build is currently in progress. This state was then used in the GenericNode and BuildTrigger components to conditionally render certain elements based on whether a build is in progress or not. --- src/frontend/src/CustomNodes/GenericNode/index.tsx | 4 ++-- .../src/components/chatComponent/buildTrigger/index.tsx | 3 +-- src/frontend/src/contexts/SSEContext.tsx | 5 ++++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index fdf830408..b56b15352 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -29,7 +29,7 @@ export default function GenericNode({ const Icon = nodeIcons[data.type] || nodeIcons[types[data.type]]; const [validationStatus, setValidationStatus] = useState(null); // State for outline color - const { sseData } = useSSE(); + const { sseData,isBuilding } = useSSE(); // useEffect(() => { // if (reactFlowInstance) { @@ -137,7 +137,7 @@ export default function GenericNode({ >