diff --git a/Library/0BDFDB.plugin.js b/Library/0BDFDB.plugin.js index d8cdabd6da..b4b8582689 100644 --- a/Library/0BDFDB.plugin.js +++ b/Library/0BDFDB.plugin.js @@ -2,7 +2,7 @@ * @name BDFDB * @author DevilBro * @authorId 278543574059057154 - * @version 3.2.6 + * @version 3.2.7 * @description Required Library for DevilBro's Plugins * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -3116,13 +3116,22 @@ module.exports = (_ => { BDFDB.TimeUtils.clear(BDFDB.ChannelUtils.rerenderAll.timeout); BDFDB.ChannelUtils.rerenderAll.timeout = BDFDB.TimeUtils.timeout(_ => { let ChannelsIns = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.guildchannels), {name: "ChannelsList", unlimited: true}); - let ChannelsPrototype = BDFDB.ObjectUtils.get(ChannelsIns, `${BDFDB.ReactUtils.instanceKey}.type.prototype`); - if (ChannelsIns && ChannelsPrototype) { - BDFDB.PatchUtils.patch({name: "BDFDB ChannelUtils"}, ChannelsPrototype, "render", {after: e => { - e.returnValue.props.children = typeof e.returnValue.props.children == "function" ? (_ => {return null;}) : []; - BDFDB.ReactUtils.forceUpdate(ChannelsIns); - }}, {once: true}); - BDFDB.ReactUtils.forceUpdate(ChannelsIns); + if (!ChannelsIns) return; + else { + if (ChannelsIns && ChannelsIns.props && ChannelsIns.props.guildChannels.categories && Object.keys(ChannelsIns.props.guildChannels.categories).length) { + let category = ChannelsIns.props.guildChannels.categories[Object.keys(ChannelsIns.props.guildChannels.categories)[0]]; + category.isCollapsed ? BDFDB.LibraryModules.CategoryCollapseUtils.collapse(category.id) : BDFDB.LibraryModules.CategoryCollapseUtils.expand(category.id); + } + else { + let ChannelsPrototype = BDFDB.ObjectUtils.get(ChannelsIns, `${BDFDB.ReactUtils.instanceKey}.type.prototype`); + if (ChannelsIns && ChannelsPrototype) { + BDFDB.PatchUtils.patch({name: "BDFDB ChannelUtils"}, ChannelsPrototype, "render", {after: e => { + e.returnValue.props.children = typeof e.returnValue.props.children == "function" ? (_ => {return null;}) : []; + BDFDB.ReactUtils.forceUpdate(ChannelsIns); + }}, {once: true}); + BDFDB.ReactUtils.forceUpdate(ChannelsIns); + } + } } }, instant ? 0 : 1000); }; diff --git a/Plugins/HideMutedCategories/HideMutedCategories.plugin.js b/Plugins/HideMutedCategories/HideMutedCategories.plugin.js index b4a815bbe3..8eb6854ab4 100644 --- a/Plugins/HideMutedCategories/HideMutedCategories.plugin.js +++ b/Plugins/HideMutedCategories/HideMutedCategories.plugin.js @@ -2,7 +2,7 @@ * @name HideMutedCategories * @author DevilBro * @authorId 278543574059057154 - * @version 1.1.1 + * @version 1.1.2 * @description Hides muted Categories, if muted Channels are hidden * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -78,11 +78,11 @@ module.exports = (_ => { } onStart () { - BDFDB.PatchUtils.forceAllUpdates(this); + BDFDB.ChannelUtils.rerenderAll(); } onStop () { - BDFDB.PatchUtils.forceAllUpdates(this); + BDFDB.ChannelUtils.rerenderAll(); } processChannelsList (e) {