File tree 3 files changed +10
-2
lines changed
components/ai-chat/component/operation-button
3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ const playAnswerTextPart = () => {
200
200
if (audioList .value [currentAudioIndex .value ] !== utterance .value ?.text ) {
201
201
window .speechSynthesis .cancel ()
202
202
}
203
- if (window .speechSynthesis .paused ) {
203
+ if (window .speechSynthesis .paused && audioList . value [ currentAudioIndex . value ] === utterance . value ?. text ) {
204
204
window .speechSynthesis .resume ()
205
205
return
206
206
}
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ const playAnswerTextPart = () => {
176
176
if (audioList .value [currentAudioIndex .value ] !== utterance .value ?.text ) {
177
177
window .speechSynthesis .cancel ()
178
178
}
179
- if (window .speechSynthesis .paused ) {
179
+ if (window .speechSynthesis .paused && audioList . value [ currentAudioIndex . value ] === utterance . value ?. text ) {
180
180
window .speechSynthesis .resume ()
181
181
return
182
182
}
Original file line number Diff line number Diff line change @@ -321,6 +321,14 @@ const clickListHandle = (item: any) => {
321
321
currentChatName .value = item .abstract
322
322
if (currentChatId .value !== ' new' ) {
323
323
getChatRecord ()
324
+
325
+ // 切换对话后,取消暂停的浏览器播放
326
+ if (window .speechSynthesis .paused && window .speechSynthesis .speaking ) {
327
+ window .speechSynthesis .resume ()
328
+ nextTick (() => {
329
+ window .speechSynthesis .cancel ()
330
+ })
331
+ }
324
332
}
325
333
}
326
334
if (common .isMobile ()) {
You can’t perform that action at this time.
0 commit comments