From 6ba499fda5b5520cac1ffc50d96e30c9504b47f4 Mon Sep 17 00:00:00 2001 From: Rohini-Microsoft <168007985+Rohini-Microsoft@users.noreply.github.com> Date: Mon, 5 Aug 2024 20:02:46 +0530 Subject: [PATCH] fix: Previously recorded question reappears if clicked on mic repeatedly. (#1205) --- code/frontend/src/pages/chat/Chat.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/frontend/src/pages/chat/Chat.tsx b/code/frontend/src/pages/chat/Chat.tsx index c73a37b1a..62be5df3b 100644 --- a/code/frontend/src/pages/chat/Chat.tsx +++ b/code/frontend/src/pages/chat/Chat.tsx @@ -188,6 +188,9 @@ const Chat = () => { }; const onMicrophoneClick = async () => { + // clear the previous text + setUserMessage(""); + setRecognizedText(""); if (!isRecognizing) { setSendButtonDisabled(true); await startSpeechRecognition();