From 46ba1d7273270a0ae870040fb587dd56d1d3d245 Mon Sep 17 00:00:00 2001 From: 3nd3r Date: Sun, 12 Apr 2026 12:55:20 -0500 Subject: [PATCH] Fix #6: Add missing DOM elements, fix null references - Add violet-trial-badge span to index.html header - Add null guard in updateVioletBadge() for safety - Remove dead $('tab-ai-violet') reference (Violet tab is dynamic) - Fix duplicate trialBadge declaration and restore hidden logic --- index.html | 1 + static/chat.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 69e80a5..6188f2a 100644 --- a/index.html +++ b/index.html @@ -87,6 +87,7 @@
+
diff --git a/static/chat.js b/static/chat.js index 9733705..0bde142 100644 --- a/static/chat.js +++ b/static/chat.js @@ -367,6 +367,7 @@ socket.on("ignore_status", (data) => { }); function updateVioletBadge() { + if (!trialBadge) return; if (state.hasAiAccess) { trialBadge.classList.add("hidden"); } else { @@ -587,7 +588,7 @@ $("sidebar-toggle").onclick = () => { sidebar.classList.toggle("open"); }; -$("tab-ai-violet").onclick = () => switchTab("ai-violet"); +// tab-ai-violet is created dynamically when user opens Violet PM $("tab-lobby").onclick = () => switchTab("lobby"); $("close-paywall").onclick = () => paywallModal.classList.add("hidden");