commit
08ae8dceb5
|
@ -78,6 +78,12 @@ export default class BuiltinModule {
|
|||
Patch(`BD:${this.moduleName}`, module)[when](fnName, cb.bind(this));
|
||||
}
|
||||
|
||||
childPatch(module, fnName, child, cb, when = 'after') {
|
||||
this.patch(module, fnName, (component, args, retVal) => {
|
||||
this.patch(retVal[child[0]], child[1], cb, when);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Logger wraps
|
||||
*/
|
||||
|
|
|
@ -227,7 +227,7 @@ export default new class EmoteModule extends BuiltinModule {
|
|||
*/
|
||||
async patchMessageContent() {
|
||||
const MessageContent = await ReactComponents.getComponent('MessageContent', { selector: Reflection.resolve('container', 'containerCozy', 'containerCompact', 'edited').selector }, m => m.defaultProps && m.defaultProps.hasOwnProperty('disableButtons'));
|
||||
this.patch(MessageContent.component.prototype, 'render', this.afterRenderMessageContent);
|
||||
this.childPatch(MessageContent.component.prototype, 'render', ['props', 'children'], this.afterRenderMessageContent);
|
||||
MessageContent.forceUpdateAll();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue