Fix Guild component selection
This commit is contained in:
parent
3a7ac06ce3
commit
db21f4eb13
|
@ -384,7 +384,8 @@ export class ReactAutoPatcher {
|
||||||
}
|
}
|
||||||
|
|
||||||
static async patchGuild() {
|
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) => {
|
this.unpatchGuild = MonkeyPatch('BD:ReactComponents', this.Guild.component.prototype).after('render', (component, args, retVal) => {
|
||||||
const { guild } = component.props;
|
const { guild } = component.props;
|
||||||
|
@ -393,9 +394,7 @@ export class ReactAutoPatcher {
|
||||||
retVal.props['data-guild-name'] = guild.name;
|
retVal.props['data-guild-name'] = guild.name;
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const e of document.querySelectorAll('.guild')) {
|
this.Guild.forceUpdateAll();
|
||||||
Reflection(e).forceUpdate();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static async patchChannel() {
|
static async patchChannel() {
|
||||||
|
|
Loading…
Reference in New Issue