From e33823754f32a8db57fcbe9db81139c8cdebf14e Mon Sep 17 00:00:00 2001 From: xqdoo00o Date: Mon, 3 Jun 2024 01:22:01 +0800 Subject: [PATCH] fix gemini edge case --- index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.html b/index.html index 6d92d10..2c658ba 100644 --- a/index.html +++ b/index.html @@ -8211,6 +8211,12 @@ let endIdx = value.lastIndexOf("}"); payload = JSON.parse(value.slice(startIdx, endIdx + 1)); } catch (e) { + if (value === "]") { + if (existVoice && enableAutoVoice && currentVoiceIdx === autoVoiceDataIdx) { + let voiceText = longReplyFlag ? "" : progressData.slice(autoVoiceIdx); + autoSpeechEvent(voiceText, currentResEle, false, true); + } + } return readChunk(); } let content = payload.candidates[0].content.parts[0].text;