Update SpeechRecognition.tsx

This commit is contained in:
bsu3338 2023-08-09 14:48:31 -05:00 committed by GitHub
parent e7d7d7325d
commit e313637229
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,7 +60,9 @@ const useSpeechRecognition = (ask) => {
if (event) {
event.preventDefault();
}
setIsListening((prevState) => !prevState);
if (isSpeechSupported) {
setIsListening((prevState) => !prevState);
}
};
return { isSpeechSupported, isListening, text, toggleListening };