From 6626d2a8f9438897ac6661e208d845704a557be6 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Wed, 15 Apr 2026 00:53:42 +0200 Subject: [PATCH] fix(pitch-deck): fix ReferenceError in ChatFAB breaking 2nd message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit faqMatch (undefined) → faqMatches[0]. The undefined variable caused a ReferenceError after streaming completed, which the catch block turned into "Verbindung fehlgeschlagen" for every subsequent message. Co-Authored-By: Claude Opus 4.6 (1M context) --- pitch-deck/components/ChatFAB.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pitch-deck/components/ChatFAB.tsx b/pitch-deck/components/ChatFAB.tsx index 26006af..d6f34f9 100644 --- a/pitch-deck/components/ChatFAB.tsx +++ b/pitch-deck/components/ChatFAB.tsx @@ -286,10 +286,11 @@ export default function ChatFAB({ } // If FAQ matched and has a goto_slide, add a GOTO marker to the response - if (faqMatch?.goto_slide) { - const gotoIdx = SLIDE_ORDER.indexOf(faqMatch.goto_slide) + const topMatch = faqMatches[0] + if (topMatch?.goto_slide) { + const gotoIdx = SLIDE_ORDER.indexOf(topMatch.goto_slide) if (gotoIdx >= 0) { - const suffix = `\n\n[GOTO:${faqMatch.goto_slide}]` + const suffix = `\n\n[GOTO:${topMatch.goto_slide}]` content += suffix setMessages(prev => { const updated = [...prev]