From 3131fd3531bc876b4bfb8663ab8e3bde0ba7d34a Mon Sep 17 00:00:00 2001 From: "N0\\A" Date: Fri, 9 Jan 2026 00:45:01 +0100 Subject: [PATCH] Hopefully? --- ui/index.html | 2 +- ui/script.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ui/index.html b/ui/index.html index a935143..05ab537 100644 --- a/ui/index.html +++ b/ui/index.html @@ -150,6 +150,6 @@ - + diff --git a/ui/script.js b/ui/script.js index f6b30e0..4cf91ea 100644 --- a/ui/script.js +++ b/ui/script.js @@ -66,7 +66,7 @@ document.addEventListener("DOMContentLoaded", () => { isFetching = true; status.textContent = "Thinking..."; - statusIndicator.classList.add("fetching"); + if (statusIndicator) statusIndicator.classList.add("fetching"); const n = parseInt(nGramSelect.value); const temperature = parseFloat(tempInput.value); @@ -95,7 +95,7 @@ document.addEventListener("DOMContentLoaded", () => { } finally { isFetching = false; status.textContent = "Idle"; - statusIndicator.classList.remove("fetching"); + if (statusIndicator) statusIndicator.classList.remove("fetching"); } }; @@ -167,10 +167,12 @@ document.addEventListener("DOMContentLoaded", () => { } }); - generateBtn.addEventListener("click", () => { - fetchPrediction(editor.value, 50); - closeSidebarOnMobile(); - }); + if (generateBtn) { + generateBtn.addEventListener("click", () => { + fetchPrediction(editor.value, 50); + closeSidebarOnMobile(); + }); + } // Sync scroll editor.addEventListener("scroll", () => {