From 558b35f4fd5d9c534c8087982d058da58d73af50 Mon Sep 17 00:00:00 2001 From: booploops <49113086+booploops@users.noreply.github.com> Date: Fri, 25 Feb 2022 17:08:54 -0800 Subject: [PATCH] theme directive adjust --- src/renderer/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/renderer/index.js b/src/renderer/index.js index 3777c306..911b57d8 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -908,7 +908,7 @@ const app = new Vue({ } else { this.cfg.visual.theme = theme } - this.chrome.appliedTheme.info = await fetch("themes/" + app.cfg.visual.theme.replace("index.less", "theme.json")) + this.chrome.appliedTheme.info = await (await fetch("themes/" + app.cfg.visual.theme.replace("index.less", "theme.json"))).json() document.querySelector("#userTheme").href = `themes/${this.cfg.visual.theme}` @@ -918,8 +918,11 @@ const app = new Vue({ less.refresh() }, getThemeDirective(directive = "") { + if(typeof this.chrome.appliedTheme.info != "object") { + return + } if(this.chrome.appliedTheme.info.directives[directive]) { - return this.chrome.appliedTheme.info.directives[directive] + return this.chrome.appliedTheme.info.directives[directive].value } else { return "" }