From f309ef30f4b5cab59474e5b9d5cc2df6ba008fff Mon Sep 17 00:00:00 2001 From: TinyTerra <115619949+TinyTerra@users.noreply.github.com> Date: Sun, 16 Feb 2025 22:59:28 +0100 Subject: [PATCH] Update ttN.js --- js/ttN.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/js/ttN.js b/js/ttN.js index 726b95e..31e0999 100644 --- a/js/ttN.js +++ b/js/ttN.js @@ -617,14 +617,19 @@ class TinyTerra extends EventTarget { this.downKeys["^" + e.key.toLocaleUpperCase()] = false } injectTtnCss() { - const folders = ['ComfyUI_tinyterraNodes','comfyui_tinyterranodes'] - folders.forEach((folder) => { - let link = document.createElement("link"); - link.rel = "stylesheet"; - link.type = "text/css"; - link.href = `extensions/${folder}/ttN.css`; - document.head.appendChild(link); - }) + const link = document.createElement("link"); + link.rel = "stylesheet"; + link.type = "text/css"; + link.href = "extensions/ComfyUI_tinyterraNodes/ttN.css"; + + link.onerror = function () { + if (this.href.includes("comfyui_tinyterranodes")) { + console.error("tinyterraNodes: Failed to load CSS file. Please check nodepack folder name."); + return; + } + this.href = "extensions/comfyui_tinyterranodes/ttN.css" + } + document.head.appendChild(link); } }