Fix console.log guild render spam (#289)

* Update main.js

* Update main.js

* Update main.min.js
This commit is contained in:
Mirco Wittrien 2020-01-04 15:34:51 +01:00 committed by Zack
parent 21981b15e8
commit 4daf2cd465
2 changed files with 13 additions and 11 deletions

View File

@ -2642,16 +2642,18 @@ class V2 {
const GuildComponent = reactInstance.return.type; const GuildComponent = reactInstance.return.type;
if (!GuildComponent) return; if (!GuildComponent) return;
this.guildListItemsPatch = BdApi.monkeyPatch(GuildComponent.prototype, "render", {after: (data) => { this.guildListItemsPatch = BdApi.monkeyPatch(GuildComponent.prototype, "render", {after: (data) => {
const returnValue = data.returnValue; if (data.returnValue && data.thisObject) {
const guildData = data.thisObject.props; const returnValue = data.returnValue;
returnValue.props.className += " bd-guild"; const guildData = data.thisObject.props;
if (guildData.unread) returnValue.props.className += " bd-unread"; returnValue.props.className += " bd-guild";
if (guildData.selected) returnValue.props.className += " bd-selected"; if (guildData.unread) returnValue.props.className += " bd-unread";
if (guildData.audio) returnValue.props.className += " bd-audio"; if (guildData.selected) returnValue.props.className += " bd-selected";
if (guildData.video) returnValue.props.className += " bd-video"; if (guildData.audio) returnValue.props.className += " bd-audio";
if (guildData.badge) returnValue.props.className += " bd-badge"; if (guildData.video) returnValue.props.className += " bd-video";
if (guildData.animatable) returnValue.props.className += " bd-animatable"; if (guildData.badge) returnValue.props.className += " bd-badge";
return returnValue; if (guildData.animatable) returnValue.props.className += " bd-animatable";
return returnValue;
}
}}); }});
} }

2
js/main.min.js vendored

File diff suppressed because one or more lines are too long