mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-03 22:32:42 +00:00
🔇 fix: Suppress Expected Speech Synthesis Cancellation Errors (#13627)
This commit is contained in:
parent
cecaa174ce
commit
7791fcfe39
1 changed files with 6 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { useRecoilValue } from 'recoil';
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import type { VoiceOption } from '~/common';
|
||||
import store from '~/store';
|
||||
|
||||
|
|
@ -89,6 +89,11 @@ function useTextToSpeechBrowser({
|
|||
setIsSpeaking(false);
|
||||
};
|
||||
utterance.onerror = (event) => {
|
||||
if (event.error === 'interrupted' || event.error === 'canceled') {
|
||||
setIsSpeaking(false);
|
||||
return;
|
||||
}
|
||||
|
||||
console.error('Speech synthesis error:', event);
|
||||
setIsSpeaking(false);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue