Fix console.log guild render spam (#289)
* Update main.js * Update main.js * Update main.min.js
This commit is contained in:
parent
21981b15e8
commit
4daf2cd465
22
js/main.js
22
js/main.js
|
@ -2642,16 +2642,18 @@ class V2 {
|
|||
const GuildComponent = reactInstance.return.type;
|
||||
if (!GuildComponent) return;
|
||||
this.guildListItemsPatch = BdApi.monkeyPatch(GuildComponent.prototype, "render", {after: (data) => {
|
||||
const returnValue = data.returnValue;
|
||||
const guildData = data.thisObject.props;
|
||||
returnValue.props.className += " bd-guild";
|
||||
if (guildData.unread) returnValue.props.className += " bd-unread";
|
||||
if (guildData.selected) returnValue.props.className += " bd-selected";
|
||||
if (guildData.audio) returnValue.props.className += " bd-audio";
|
||||
if (guildData.video) returnValue.props.className += " bd-video";
|
||||
if (guildData.badge) returnValue.props.className += " bd-badge";
|
||||
if (guildData.animatable) returnValue.props.className += " bd-animatable";
|
||||
return returnValue;
|
||||
if (data.returnValue && data.thisObject) {
|
||||
const returnValue = data.returnValue;
|
||||
const guildData = data.thisObject.props;
|
||||
returnValue.props.className += " bd-guild";
|
||||
if (guildData.unread) returnValue.props.className += " bd-unread";
|
||||
if (guildData.selected) returnValue.props.className += " bd-selected";
|
||||
if (guildData.audio) returnValue.props.className += " bd-audio";
|
||||
if (guildData.video) returnValue.props.className += " bd-video";
|
||||
if (guildData.badge) returnValue.props.className += " bd-badge";
|
||||
if (guildData.animatable) returnValue.props.className += " bd-animatable";
|
||||
return returnValue;
|
||||
}
|
||||
}});
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue