fixes
This commit is contained in:
parent
3cc9112eb2
commit
8bbf738c2a
|
@ -13,12 +13,12 @@ module.exports = (_ => {
|
|||
"info": {
|
||||
"name": "ShowHiddenChannels",
|
||||
"author": "DevilBro",
|
||||
"version": "2.8.3",
|
||||
"version": "2.8.4",
|
||||
"description": "Display channels that are hidden from you by role restrictions"
|
||||
},
|
||||
"changeLog": {
|
||||
"added": {
|
||||
"Voice Bit-Rate": "Now shows the bit rate for voice channels in the access modal"
|
||||
"fixed": {
|
||||
"Works again": "Yes"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -155,10 +155,10 @@ module.exports = (_ => {
|
|||
this.patchedModules = {
|
||||
before: {
|
||||
Channels: "render",
|
||||
ChannelCategoryItem: "render"
|
||||
ChannelCategoryItem: "default"
|
||||
},
|
||||
after: {
|
||||
ChannelItem: ["render", "componentDidMount", "componentDidUpdate"]
|
||||
ChannelItem: "default"
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -283,6 +283,7 @@ module.exports = (_ => {
|
|||
hiddenChannelCache = {};
|
||||
|
||||
BDFDB.PatchUtils.forceAllUpdates(this);
|
||||
BDFDB.ChannelUtils.rerenderAll();
|
||||
}
|
||||
|
||||
onChannelContextMenu (e) {
|
||||
|
@ -320,6 +321,7 @@ module.exports = (_ => {
|
|||
this.saveBlacklist(BDFDB.ArrayUtils.removeCopies(blacklist));
|
||||
|
||||
BDFDB.PatchUtils.forceAllUpdates(this);
|
||||
BDFDB.ChannelUtils.rerenderAll(true);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
@ -397,37 +399,32 @@ module.exports = (_ => {
|
|||
}
|
||||
|
||||
processChannelItem (e) {
|
||||
if (e.node) {
|
||||
if (e.instance.props.className.indexOf(BDFDB.disCN.channelmodelocked) == -1) BDFDB.DOMUtils.removeClass(e.node, BDFDB.disCN.channelmodelocked);
|
||||
e.node.removeEventListener("click", BDFDB.ListenerUtils.stopEvent);
|
||||
e.node.removeEventListener("mousedown", BDFDB.ListenerUtils.stopEvent);
|
||||
e.node.removeEventListener("mouseup", BDFDB.ListenerUtils.stopEvent);
|
||||
}
|
||||
if (e.instance.props.channel && this.isChannelHidden(e.instance.props.channel.id)) {
|
||||
if (e.returnvalue) {
|
||||
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "Icon"});
|
||||
if (index > -1) children[index] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
|
||||
nativeClass: true,
|
||||
iconSVG: `<svg class="${BDFDB.disCN.channelicon}" width="24" height="24" viewBox="0 0 24 24"><mask id="${this.name + e.instance.props.channel.id}" fill="black"><path d="M 0 0 H 24 V 24 H 0 Z" fill="white"></path><path d="M24 0 H 13 V 12 H 24 Z" fill="black"></path></mask><path mask="url(#${this.name + e.instance.props.channel.id})" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="${this.channelIcons[BDFDB.DiscordConstants.ChannelTypes[e.instance.props.channel.type]] || this.channelIcons.DEFAULT}"></path><path fill="currentColor" d="M 21.025 5 V 4 C 21.025 2.88 20.05 2 19 2 C 17.95 2 17 2.88 17 4 V 5 C 16.4477 5 16 5.44772 16 6 V 9 C 16 9.55228 16.4477 10 17 10 H 19 H 21 C 21.5523 10 22 9.55228 22 9 V 5.975C22 5.43652 21.5635 5 21.025 5 Z M 20 5 H 18 V 4 C 18 3.42857 18.4667 3 19 3 C 19.5333 3 20 3.42857 20 4 V 5 Z"></path></svg>`
|
||||
});
|
||||
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.channelchildren]]});
|
||||
if (index > -1 && children[index].props && children[index].props.children) {
|
||||
children[index].props.children = [BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
|
||||
text: BDFDB.LanguageUtils.LanguageStrings.CHANNEL_LOCKED_SHORT,
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
|
||||
className: BDFDB.disCN.channelactionicon,
|
||||
name: BDFDB.LibraryComponents.SvgIcon.Names.LOCK_CLOSED
|
||||
})
|
||||
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "Icon"});
|
||||
if (index > -1) children[index] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
|
||||
nativeClass: true,
|
||||
iconSVG: `<svg class="${BDFDB.disCN.channelicon}" width="24" height="24" viewBox="0 0 24 24"><mask id="${this.name + e.instance.props.channel.id}" fill="black"><path d="M 0 0 H 24 V 24 H 0 Z" fill="white"></path><path d="M24 0 H 13 V 12 H 24 Z" fill="black"></path></mask><path mask="url(#${this.name + e.instance.props.channel.id})" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="${this.channelIcons[BDFDB.DiscordConstants.ChannelTypes[e.instance.props.channel.type]] || this.channelIcons.DEFAULT}"></path><path fill="currentColor" d="M 21.025 5 V 4 C 21.025 2.88 20.05 2 19 2 C 17.95 2 17 2.88 17 4 V 5 C 16.4477 5 16 5.44772 16 6 V 9 C 16 9.55228 16.4477 10 17 10 H 19 H 21 C 21.5523 10 22 9.55228 22 9 V 5.975C22 5.43652 21.5635 5 21.025 5 Z M 20 5 H 18 V 4 C 18 3.42857 18.4667 3 19 3 C 19.5333 3 20 3.42857 20 4 V 5 Z"></path></svg>`
|
||||
});
|
||||
let channelChildren = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.channelchildren]]});
|
||||
if (channelChildren && channelChildren.props && channelChildren.props.children) {
|
||||
channelChildren.props.children = [BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
|
||||
text: BDFDB.LanguageUtils.LanguageStrings.CHANNEL_LOCKED_SHORT,
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
|
||||
className: BDFDB.disCN.channelactionicon,
|
||||
name: BDFDB.LibraryComponents.SvgIcon.Names.LOCK_CLOSED
|
||||
})
|
||||
})];
|
||||
}
|
||||
})
|
||||
})];
|
||||
}
|
||||
if (e.node) {
|
||||
BDFDB.DOMUtils.addClass(e.node, BDFDB.disCN.channelmodelocked);
|
||||
e.node.addEventListener("click", BDFDB.ListenerUtils.stopEvent);
|
||||
e.node.addEventListener("mousedown", BDFDB.ListenerUtils.stopEvent);
|
||||
e.node.addEventListener("mouseup", BDFDB.ListenerUtils.stopEvent);
|
||||
let wrapper = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.channelwrapper]]});
|
||||
if (wrapper) {
|
||||
wrapper.props.onMouseDown = _ => {};
|
||||
wrapper.props.onMouseUp = _ => {};
|
||||
}
|
||||
let maincontent = BDFDB.ReactUtils.findChild(e.returnvalue, {props:[["className", BDFDB.disCN.channelmaincontent]]});
|
||||
if (maincontent) {
|
||||
maincontent.props.onClick = _ => {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -700,4 +697,4 @@ module.exports = (_ => {
|
|||
}
|
||||
};
|
||||
})(window.BDFDB_Global.PluginUtils.buildPlugin(config));
|
||||
})();
|
||||
})();
|
Loading…
Reference in New Issue