Clear chat on agent change

Clear the conversation history when the selected agent changes in the "Testar Agente" screen.
This commit is contained in:
gpt-engineer-app[bot]
2025-11-07 19:55:54 +00:00
parent f1362dbf01
commit 7b01dd2e55
+5
View File
@@ -39,6 +39,11 @@ export default function TestPrompt() {
} }
}, [messages]); }, [messages]);
// Limpa a conversa ao trocar de agente
useEffect(() => {
setMessages([]);
}, [selectedAgent]);
const handleSend = () => { const handleSend = () => {
if (!input.trim() || !selectedAgent) return; if (!input.trim() || !selectedAgent) return;