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.
This commit is contained in:
Alexander G. Morano
2025-06-04 14:17:16 -04:00
committed by GitHub
parent dff702527d
commit 4e1d589b7d
+7 -4
View File
@@ -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)
}