diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-04-13 21:15:31 +0200 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-04-13 21:15:31 +0200 |
commit | 070eeadc12dde13c273cc12529541375c6875c7c (patch) | |
tree | 1e207c139b0c82344c68812b0b17eb50b2a062d3 /g4f/gui/client/static/js | |
parent | Fix SpeechRecognition on Phone (diff) | |
download | gpt4free-070eeadc12dde13c273cc12529541375c6875c7c.tar gpt4free-070eeadc12dde13c273cc12529541375c6875c7c.tar.gz gpt4free-070eeadc12dde13c273cc12529541375c6875c7c.tar.bz2 gpt4free-070eeadc12dde13c273cc12529541375c6875c7c.tar.lz gpt4free-070eeadc12dde13c273cc12529541375c6875c7c.tar.xz gpt4free-070eeadc12dde13c273cc12529541375c6875c7c.tar.zst gpt4free-070eeadc12dde13c273cc12529541375c6875c7c.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/gui/client/static/js/chat.v1.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/g4f/gui/client/static/js/chat.v1.js b/g4f/gui/client/static/js/chat.v1.js index 5784b05a..9194ad4f 100644 --- a/g4f/gui/client/static/js/chat.v1.js +++ b/g4f/gui/client/static/js/chat.v1.js @@ -1287,10 +1287,11 @@ if (SpeechRecognition) { } }; recognition.onresult = function(event) { + window.clearTimeout(timeoutHandle); + timeoutHandle = window.setTimeout(may_stop, transcript ? 10000 : 8000); if (!event.results) { return; } - window.clearTimeout(timeoutHandle); let result = event.results[event.resultIndex]; let isFinal = result.isFinal && (result[0].confidence > 0); @@ -1309,8 +1310,6 @@ if (SpeechRecognition) { messageInput.style.height = messageInput.scrollHeight + "px"; messageInput.scrollTop = messageInput.scrollHeight; } - - timeoutHandle = window.setTimeout(may_stop, transcript ? 10000 : 8000); }; microLabel.addEventListener("click", () => { |