Update EditChannels.plugin.js

This commit is contained in:
Mirco Wittrien 2024-01-09 12:54:40 +01:00
parent ba5ec27a2e
commit c43b70f738
1 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
* @name EditChannels * @name EditChannels
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 4.5.5 * @version 4.5.6
* @description Allows you to locally edit Channels * @description Allows you to locally edit Channels
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -542,7 +542,7 @@ module.exports = (_ => {
let childrenRender = e.returnvalue.props.children; let childrenRender = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args2) => { e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args2) => {
let renderedChildren = childrenRender(...args2); let renderedChildren = childrenRender(...args2);
this.changeChannelIconColor(renderedChildren.props.children, e.instance.props.channel.id, modify); this.changeChannelIconColor(renderedChildren.props.children[1] || renderedChildren.props.children, e.instance.props.channel.id, modify);
return renderedChildren; return renderedChildren;
}, "Error in Children Render of ChannelItem!", this); }, "Error in Children Render of ChannelItem!", this);
} }
@ -763,7 +763,7 @@ module.exports = (_ => {
changeChannelIconColor (child, channelId, modify) { changeChannelIconColor (child, channelId, modify) {
if (!this.settings.general.changeChannelIcon) return; if (!this.settings.general.changeChannelIcon) return;
let color = child && this.getChannelDataColor(channelId); let color = child && child.props && this.getChannelDataColor(channelId);
if (!color) return; if (!color) return;
color = modify ? this.chooseColor(BDFDB.ObjectUtils.is(color) ? color[0] : color, modify) : BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(color) ? color[0] : color, "RGBA"); color = modify ? this.chooseColor(BDFDB.ObjectUtils.is(color) ? color[0] : color, modify) : BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(color) ? color[0] : color, "RGBA");
if (!color) return; if (!color) return;