From e3136372295ab4c3ec6abebb45ef2f78c1b15573 Mon Sep 17 00:00:00 2001 From: bsu3338 Date: Wed, 9 Aug 2023 14:48:31 -0500 Subject: [PATCH] Update SpeechRecognition.tsx --- client/src/components/Input/SpeechRecognition.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/components/Input/SpeechRecognition.tsx b/client/src/components/Input/SpeechRecognition.tsx index a927d1edf5..26cfec7dc4 100644 --- a/client/src/components/Input/SpeechRecognition.tsx +++ b/client/src/components/Input/SpeechRecognition.tsx @@ -60,7 +60,9 @@ const useSpeechRecognition = (ask) => { if (event) { event.preventDefault(); } - setIsListening((prevState) => !prevState); + if (isSpeechSupported) { + setIsListening((prevState) => !prevState); + } }; return { isSpeechSupported, isListening, text, toggleListening };