From e095b08b223a3f651769441ec51352924a282a3b Mon Sep 17 00:00:00 2001 From: NguyenND Date: Tue, 9 Jun 2026 16:20:59 -0400 Subject: [PATCH] 06/09 Fix chatbot common questions doesn't work --- app/templates/support/chat.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/templates/support/chat.html b/app/templates/support/chat.html index 12a406e..4450b36 100644 --- a/app/templates/support/chat.html +++ b/app/templates/support/chat.html @@ -60,7 +60,8 @@
{% for faq in faqs %} {% endfor %} @@ -159,7 +160,8 @@ let history = []; // ── Greeting on page load ────────────────────────────────────────────── - appendMessage('ai', "👋 Hi {{ current_user.display_name }}! I'm your JQC support assistant. " + + var userName = {{ current_user.display_name | tojson }}; + appendMessage('ai', "👋 Hi " + userName + "! I'm your JQC support assistant. " + "I can help you with inspections, issues, reports, and more. " + "Click a question below or type your own."); @@ -249,9 +251,9 @@ sendMessage(chatInput.value); }; - window.sendFaq = function (btn, text) { + window.sendFaq = function (btn) { btn.disabled = true; - sendMessage(text); + sendMessage(btn.dataset.faq); }; // ── Enter key support ──────────────────────────────────────────────────