Fix Guild component selection

This commit is contained in:
Samuel Elliott 2018-08-01 20:40:03 +01:00
parent 3a7ac06ce3
commit db21f4eb13
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
1 changed files with 3 additions and 4 deletions

View File

@ -384,7 +384,8 @@ export class ReactAutoPatcher {
}
static async patchGuild() {
this.Guild = await ReactComponents.getComponent('Guild');
const selector = `div.${WebpackModules.getClassName('guild', 'guildsWrapper')}:not(:first-child)`;
this.Guild = await ReactComponents.getComponent('Guild', {selector}, m => m.prototype.renderBadge);
this.unpatchGuild = MonkeyPatch('BD:ReactComponents', this.Guild.component.prototype).after('render', (component, args, retVal) => {
const { guild } = component.props;
@ -393,9 +394,7 @@ export class ReactAutoPatcher {
retVal.props['data-guild-name'] = guild.name;
});
for (const e of document.querySelectorAll('.guild')) {
Reflection(e).forceUpdate();
}
this.Guild.forceUpdateAll();
}
static async patchChannel() {