From 4e1d589b7dc4ce829ac0ded22785c21258ccb177 Mon Sep 17 00:00:00 2001 From: "Alexander G. Morano" Date: Wed, 4 Jun 2025 14:17:16 -0400 Subject: [PATCH] Update sidebar_node.js Patches the sidebar to work with Jovi_Colorizer extension once again. Pulls title colors for node entries and colors them with said color entry in the sidebar. --- app/js/sidebar_node.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/js/sidebar_node.js b/app/js/sidebar_node.js index cb34130..faac768 100644 --- a/app/js/sidebar_node.js +++ b/app/js/sidebar_node.js @@ -39,12 +39,15 @@ jsloader(cnPath + "js/functions/settings.js"); let CUSTOM_COLORS; - +const SETTING_THEME = 'jovi.color.theme'; try { - var response = await api.fetchApi("/jovimetrix/config", { cache: "no-store" }) - const CONFIG_CORE = await response.json() - CUSTOM_COLORS = CONFIG_CORE?.user?.default?.color?.theme; + CUSTOM_COLORS = app.extensionManager.setting.get(SETTING_THEME) || {}; + Object.keys(DEFAULT_THEME).forEach(key => { + if (!(key in CONFIG_THEME)) { + CONFIG_THEME[key] = DEFAULT_THEME[key]; + } + }); } catch (err) { console.log(err) }