From 86b3aefe89faf1305aa1df9a715621b93287ab77 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Mon, 30 Dec 2024 10:40:01 -0300 Subject: [PATCH] fix: Prevent template value from overriding user input on tab switch (#5369) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛 (newChatView.tsx): fix issue where chat value was not being cleared when tab is hidden * 🔧 (newChatView.tsx): refactor setting chat value to handle additional condition for better logic clarity --- .../src/modals/IOModal/components/chatView/chat-view.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/modals/IOModal/components/chatView/chat-view.tsx b/src/frontend/src/modals/IOModal/components/chatView/chat-view.tsx index a074058a8..49d9be259 100644 --- a/src/frontend/src/modals/IOModal/components/chatView/chat-view.tsx +++ b/src/frontend/src/modals/IOModal/components/chatView/chat-view.tsx @@ -98,7 +98,7 @@ export default function ChatView({ return new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime(); }); - if (messages.length === 0 && !lockChat && chatInputNode) { + if (messages.length === 0 && !lockChat && chatInputNode && isTabHidden) { setChatValueStore( chatInputNode.data.node.template["input_value"].value ?? "", );