diff --git a/app/components/voice-input.tsx b/app/components/voice-input.tsx index 48cdf8612..d26820873 100644 --- a/app/components/voice-input.tsx +++ b/app/components/voice-input.tsx @@ -59,13 +59,15 @@ export default function VoiceInput({ if (!userInput || userInput.trim() === "") { setTempUserInput(""); setVoiceInputText(""); + recognizer.current?.close(); + recognizer.current = undefined; + setVoiceInputLoading(false); } else { if (!/\[\.\.\.\]$/.test(userInput)) { setTempUserInput(userInput); } } }, [userInput]); - useEffect(() => {}, [tempUserInput]); useEffect(() => { if (voiceInputText.trim() !== "") {