🔇 fix: Suppress Expected Speech Synthesis Cancellation Errors (#13627)

This commit is contained in:
Ravi Kumar L 2026-06-09 16:31:41 -04:00 committed by GitHub
parent cecaa174ce
commit 7791fcfe39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
};