From 05aca456260824279225a28a521386878d043481 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Fri, 31 Jan 2020 14:20:53 +0100 Subject: [PATCH] Update BDFDB.js --- Plugins/BDFDB.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Plugins/BDFDB.js b/Plugins/BDFDB.js index d366939c4b..fceaa73efc 100644 --- a/Plugins/BDFDB.js +++ b/Plugins/BDFDB.js @@ -1966,6 +1966,13 @@ } }; + BDFDB.MessageUtils = {}; + BDFDB.MessageUtils.rerenderChat = function () { + let isCompact = BDFDB.DiscordUtils.getMode() == "compact"; + LibraryModules.SettingsUtils.updateLocalSettings({messageDisplayCompact:!isCompact}); + LibraryModules.SettingsUtils.updateLocalSettings({messageDisplayCompact:isCompact}); + }; + BDFDB.UserUtils = {}; var myDataUser = LibraryModules.CurrentUserStore ? LibraryModules.CurrentUserStore.getCurrentUser() : null; BDFDB.UserUtils.is = function (user) { @@ -4212,11 +4219,14 @@ return version; } }; + BDFDB.DiscordUtils.isDevModeEnabled = function () { + return LibraryModules.StoreUtils.get("UserSettingsStore").developerMode; + }; BDFDB.DiscordUtils.getTheme = function () { - return BDFDB.DOMUtils.containsClass(document.documentElement, BDFDB.disCN.themelight) ? BDFDB.disCN.themelight : BDFDB.disCN.themedark; + return LibraryModules.StoreUtils.get("UserSettingsStore").theme == "dark" ? BDFDB.disCN.themedark : BDFDB.disCN.themelight; }; BDFDB.DiscordUtils.getMode = function () { - return document.querySelectorAll(BDFDB.dotCN.messagecompact).length >= document.querySelectorAll(BDFDB.dotCN.messagecozy).length ? "compact" : "cozy"; + return LibraryModules.StoreUtils.get("UserSettingsStore").message_display_compact ? "compact" : "cozy"; }; BDFDB.DiscordUtils.getZoomFactor = function () { var arects = BDFDB.DOMUtils.getRects(document.querySelector(BDFDB.dotCN.appmount));