From 41306d6cde2211cc49ad898cabaf9cf9f3f0b599 Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Fri, 14 May 2021 20:27:59 +0200 Subject: [PATCH] Add barebones theme loading! --- utils/theme.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/utils/theme.js b/utils/theme.js index e9b5d63..d5605e6 100644 --- a/utils/theme.js +++ b/utils/theme.js @@ -1,7 +1,14 @@ const themeFolder = __dirname + "/themes/"; const fs = require("fs"); const armcord = require("./armcord.js") +window.addEventListener("DOMContentLoaded", () => { fs.readdirSync(themeFolder).forEach((file) => { - armcord.addStyle(fs.readFileSync(file)) - console.log(file) + console.log(file); + try { + const style = fs.readFileSync(`${__dirname}/themes/${file}`, "utf8"); + armcord.addStyle(style) + } catch (err) { + console.error(err); + } }); +})