From 7791fcfe39320cafc7bce97bf575822b9b25597a Mon Sep 17 00:00:00 2001 From: Ravi Kumar L Date: Tue, 9 Jun 2026 16:31:41 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=87=20fix:=20Suppress=20Expected=20Spe?= =?UTF-8?q?ech=20Synthesis=20Cancellation=20Errors=20(#13627)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/hooks/Input/useTextToSpeechBrowser.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/hooks/Input/useTextToSpeechBrowser.ts b/client/src/hooks/Input/useTextToSpeechBrowser.ts index 8fb0eecd0b..dbb59aa1e6 100644 --- a/client/src/hooks/Input/useTextToSpeechBrowser.ts +++ b/client/src/hooks/Input/useTextToSpeechBrowser.ts @@ -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); };