From 7344f3c9ce730a825c191be89cac0328eb2aa9c3 Mon Sep 17 00:00:00 2001 From: ln0422 Date: Wed, 8 Apr 2026 09:57:36 +0800 Subject: [PATCH] Fix duplicate const BASE_PATH declaration in chat.js main.js and chat.js both declared const BASE_PATH at top level. When both load on index.html, the second const throws SyntaxError, preventing chat.js from executing (chat FAB button unresponsive). Co-Authored-By: Claude Opus 4.6 --- app/static/js/chat.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/static/js/chat.js b/app/static/js/chat.js index 2ba829f..a804e8e 100644 --- a/app/static/js/chat.js +++ b/app/static/js/chat.js @@ -1,5 +1,6 @@ // ── Chat Widget JavaScript ── -const BASE_PATH = window.BASE_PATH || ''; +// BASE_PATH is declared in main.js (loaded first on index.html) +if (typeof BASE_PATH === 'undefined') var BASE_PATH = window.BASE_PATH || ''; let chatSessionId = sessionStorage.getItem('chat_session'); if (!chatSessionId) {