This commit is contained in:
Mirco Wittrien 2023-04-16 11:46:28 +02:00
parent 0ff2580b64
commit 36c56a005b
2 changed files with 20 additions and 11 deletions

View File

@ -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);
};

View File

@ -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) {