From 16666426f729bb176f080e80a84313752bc7bc74 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 7 Aug 2023 20:31:59 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(chatComponent):=20fix=20cond?= =?UTF-8?q?ition=20to=20check=20if=20parsedData.input=5Fkeys=20is=20not=20?= =?UTF-8?q?undefined=20=E2=9C=A8=20feat(chatComponent):=20add=20logic=20to?= =?UTF-8?q?=20close=20the=20connection=20and=20finish=20when=20end=5Fof=5F?= =?UTF-8?q?stream=20event=20is=20received?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/chatComponent/buildTrigger/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/components/chatComponent/buildTrigger/index.tsx b/src/frontend/src/components/chatComponent/buildTrigger/index.tsx index 4eb69546e..9b0b74678 100644 --- a/src/frontend/src/components/chatComponent/buildTrigger/index.tsx +++ b/src/frontend/src/components/chatComponent/buildTrigger/index.tsx @@ -82,13 +82,15 @@ export default function BuildTrigger({ const parsedData = JSON.parse(event.data); // if the event is the end of the stream, close the connection if (parsedData.end_of_stream) { + // Close the connection and finish + finished = true; eventSource.close(); return; } else if (parsedData.log) { // If the event is a log, log it setSuccessData({ title: parsedData.log }); - } else if (parsedData.input_keys) { + } else if (parsedData.input_keys !== undefined) { setTabsState((old) => { return { ...old,