summaryrefslogtreecommitdiffstats
path: root/g4f/gui/client
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-13 21:47:22 +0200
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-13 21:47:22 +0200
commit307ccd87818f525fdfb6cae70edca0dc689d0473 (patch)
tree985a7262c41b1432dd92410aaea9aeb95aac64b8 /g4f/gui/client
parentFix SpeechRecognition on Phone (diff)
downloadgpt4free-307ccd87818f525fdfb6cae70edca0dc689d0473.tar
gpt4free-307ccd87818f525fdfb6cae70edca0dc689d0473.tar.gz
gpt4free-307ccd87818f525fdfb6cae70edca0dc689d0473.tar.bz2
gpt4free-307ccd87818f525fdfb6cae70edca0dc689d0473.tar.lz
gpt4free-307ccd87818f525fdfb6cae70edca0dc689d0473.tar.xz
gpt4free-307ccd87818f525fdfb6cae70edca0dc689d0473.tar.zst
gpt4free-307ccd87818f525fdfb6cae70edca0dc689d0473.zip
Diffstat (limited to 'g4f/gui/client')
-rw-r--r--g4f/gui/client/static/js/chat.v1.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/g4f/gui/client/static/js/chat.v1.js b/g4f/gui/client/static/js/chat.v1.js
index 3da43d95..7f4011a2 100644
--- a/g4f/gui/client/static/js/chat.v1.js
+++ b/g4f/gui/client/static/js/chat.v1.js
@@ -1262,7 +1262,7 @@ if (SpeechRecognition) {
recognition.maxAlternatives = 1;
let startValue;
- let shouldStop = false;
+ let shouldStop;
let lastDebounceTranscript;
recognition.onstart = function() {
microLabel.classList.add("recognition");
@@ -1272,7 +1272,6 @@ if (SpeechRecognition) {
};
recognition.onend = function() {
if (shouldStop) {
- microLabel.classList.remove("recognition");
messageInput.focus();
} else {
recognition.start();
@@ -1305,6 +1304,7 @@ if (SpeechRecognition) {
if (microLabel.classList.contains("recognition")) {
shouldStop = true;
recognition.stop();
+ microLabel.classList.remove("recognition");
} else {
const lang = document.getElementById("recognition-language")?.value;
recognition.lang = lang || navigator.language;