From 6918d9417f24311919953c1b40fd7813c13470bc Mon Sep 17 00:00:00 2001 From: Lukas Parsons Date: Tue, 7 Jul 2026 00:23:10 -0400 Subject: [PATCH] Fix ReferenceError: streamingTTS is not defined in chat error handler streamingTTS const is out of scope in the catch block at handleChatSubmit. Replaced with direct window.aiTTSManager check using optional chaining. --- static/js/chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/chat.js b/static/js/chat.js index 6bca955b..8a30f607 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -3036,7 +3036,7 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer } } else { // Stop streaming TTS on any error/abort - if (streamingTTS && window.aiTTSManager) window.aiTTSManager.stop(); + if (window.aiTTSManager?.autoPlay && window.aiTTSManager?.available) window.aiTTSManager.stop(); if (currentAbort && currentAbort.signal.aborted) { const abortReason = currentAbort._reason || '';