From 2ad6c526b8ea5f518f1e1e3f7a395d023a3ed057 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Mon, 25 Dec 2023 14:43:12 -0800 Subject: [PATCH] Check if extensions block exists before changing it --- js/main.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/js/main.js b/js/main.js index f586d421..0828dee4 100644 --- a/js/main.js +++ b/js/main.js @@ -16,19 +16,20 @@ document.querySelector(".header_bar").addEventListener("click", function(event) // Check if one of the generation tabs is visible if (chat_visible || notebook_visible || default_visible) { - extensions.style.display = "flex"; + extensions && (extensions.style.display = "flex"); + if (chat_visible) { this.style.marginBottom = "0px"; - extensions.style.maxWidth = "880px"; - extensions.style.padding = "0px"; + extensions && (extensions.style.maxWidth = "880px"); + extensions && (extensions.style.padding = "0px"); } else { this.style.marginBottom = "19px"; - extensions.style.maxWidth = "none"; - extensions.style.padding = "15px"; + extensions && (extensions.style.maxWidth = "none"); + extensions && (extensions.style.padding = "15px"); } } else { this.style.marginBottom = "19px"; - extensions.style.display = "none"; + extensions && (extensions.style.display = "none"); } } });