Fix ChannelMember returning wrong component

This commit is contained in:
Samuel Elliott 2018-04-30 19:12:21 +01:00
parent 5ce78f4b32
commit 85d5de9791
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
2 changed files with 4 additions and 2 deletions

View File

@ -338,7 +338,7 @@ export class ReactAutoPatcher {
static async patchChannelMember() {
const selector = '.' + WebpackModules.getModuleByProps(['member', 'memberInner', 'activity']).member;
this.ChannelMember = await ReactComponents.getComponent('ChannelMember', { selector });
this.ChannelMember = await ReactComponents.getComponent('ChannelMember', { selector }, m => m.prototype.renderActivity);
this.unpatchChannelMemberRender = MonkeyPatch('BD:ReactComponents', this.ChannelMember.component.prototype).after('render', (component, args, retVal) => {
if (!retVal.props || !retVal.props.children) return;
const user = Helpers.findProp(component, 'user');

View File

@ -92,7 +92,9 @@ export default class extends Module {
// Rerender all channel members
if (this.PatchedNameTag) {
for (const channelMember of document.querySelectorAll('.member-2FrNV0')) {
const selector = '.' + WebpackModules.getModuleByProps(['member', 'memberInner', 'activity']).member;
for (const channelMember of document.querySelectorAll(selector)) {
Reflection(channelMember).forceUpdate();
}
}