fix: Prevent template value from overriding user input on tab switch (#5369)
* 🐛 (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
This commit is contained in:
parent
9d64d08cb5
commit
86b3aefe89
1 changed files with 1 additions and 1 deletions
|
|
@ -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 ?? "",
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue