From 167c9cc2d894af3cb258d2082138346877bc0b30 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sat, 8 Jul 2023 14:58:24 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(chatModal):=20concatenate=20?= =?UTF-8?q?message=20and=20thought=20strings=20instead=20of=20overwriting?= =?UTF-8?q?=20them=20to=20preserve=20previous=20content?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/modals/chatModal/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index 5cbc2d17b..0d783b36e 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -86,12 +86,15 @@ export default function ChatModal({ if (end) { newChat[newChat.length - 1].message = str; } else { - newChat[newChat.length - 1].message = - newChat[newChat.length - 1].message + str; + newChat[newChat.length - 1].message += str; } } if (thought) { - newChat[newChat.length - 1].thought = thought; + if (end) { + newChat[newChat.length - 1].thought = thought; + } else { + newChat[newChat.length - 1].thought += thought; + } } if (files) { newChat[newChat.length - 1].files = files;