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", () => {