返回提交历史
Modified
g4f/gui/client/static/js/chat.v1.js
+2
-2
XFEstudio/gpt4free
Fix SpeechRecognition on Phone
307ccd87
代码差异
1 个文件
+2
-2
@@ -1262,7 +1262,7 @@ if (SpeechRecognition) {
1262
1262
recognition.maxAlternatives = 1;
1263
1263
1264
1264
let startValue;
1265
let shouldStop = false;
1265
let shouldStop;
1266
1266
let lastDebounceTranscript;
1267
1267
recognition.onstart = function() {
1268
1268
microLabel.classList.add("recognition");
@@ -1272,7 +1272,6 @@ if (SpeechRecognition) {
1272
1272
};
1273
1273
recognition.onend = function() {
1274
1274
if (shouldStop) {
1275
microLabel.classList.remove("recognition");
1276
1275
messageInput.focus();
1277
1276
} else {
1278
1277
recognition.start();
@@ -1305,6 +1304,7 @@ if (SpeechRecognition) {
1305
1304
if (microLabel.classList.contains("recognition")) {
1306
1305
shouldStop = true;
1307
1306
recognition.stop();
1307
microLabel.classList.remove("recognition");
1308
1308
} else {
1309
1309
const lang = document.getElementById("recognition-language")?.value;
1310
1310
recognition.lang = lang || navigator.language;