From 39255f2c9e65bd499dcede5a3fb2b847e884f475 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Fri, 17 Apr 2026 08:16:19 +0200 Subject: [PATCH] fix(pitch-deck): hoist textLang const out of fetch object literal Syntax error: const declaration was inside the options object. Co-Authored-By: Claude Sonnet 4.6 --- pitch-deck/components/ChatFAB.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pitch-deck/components/ChatFAB.tsx b/pitch-deck/components/ChatFAB.tsx index 7e844b8..c2a6328 100644 --- a/pitch-deck/components/ChatFAB.tsx +++ b/pitch-deck/components/ChatFAB.tsx @@ -154,12 +154,10 @@ export default function ChatFAB({ ttsAbortRef.current = controller try { + const textLang = /[äöüÄÖÜß]|(?:^|\s)(?:das|die|der|und|ist|wir|ein|für|mit|auf|von|den|des)\s/i.test(cleanText) ? 'de' : lang const res = await fetch('/api/presenter/tts', { method: 'POST', headers: { 'Content-Type': 'application/json' }, - // Detect response language from text content (not UI language) - // German text typically contains umlauts, ß, or common German words - const textLang = /[äöüÄÖÜß]|(?:^|\s)(?:das|die|der|und|ist|wir|ein|für|mit|auf|von|den|des)\s/i.test(cleanText) ? 'de' : lang body: JSON.stringify({ text: cleanText, language: textLang }), signal: controller.signal, })