From d2a8586ee2b8c8074b16cff6060fc23de1b6d4ae Mon Sep 17 00:00:00 2001 From: sijinhui Date: Tue, 28 May 2024 08:37:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF=E6=97=B6?= =?UTF-8?q?=E4=B9=9F=E7=BB=93=E6=9D=9F=E8=AF=AD=E9=9F=B3=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/voice-input.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() !== "") {