Fix badges not being rendered when jumping to a message
This commit is contained in:
parent
5aa921ae4b
commit
64e855ab2d
|
@ -305,8 +305,9 @@ export class ReactAutoPatcher {
|
|||
static async patchMessage() {
|
||||
this.Message = await ReactComponents.getComponent('Message', { selector: '.message' });
|
||||
this.unpatchMessageRender = MonkeyPatch('BD:ReactComponents', this.Message.component.prototype).after('render', (component, args, retVal) => {
|
||||
const { message } = component.props;
|
||||
const { message, jumpSequenceId } = component.props;
|
||||
const { id, colorString, bot, author, attachments, embeds } = message;
|
||||
if (jumpSequenceId) retVal = retVal.props.children;
|
||||
retVal.props['data-message-id'] = id;
|
||||
retVal.props['data-colourstring'] = colorString;
|
||||
if (author && author.id) retVal.props['data-user-id'] = author.id;
|
||||
|
|
|
@ -38,6 +38,7 @@ export default class extends Module {
|
|||
|
||||
this.unpatchMessageRender = MonkeyPatch('ProfileBadges', Message.component.prototype).after('render', (component, args, retVal) => {
|
||||
if (!retVal.props || !retVal.props.children) return;
|
||||
if (ReactHelpers.findProp(component, 'jumpSequenceId')) retVal = retVal.props.children;
|
||||
|
||||
const message = ReactHelpers.findProp(component, 'message');
|
||||
if (!message || !message.author) return;
|
||||
|
|
Loading…
Reference in New Issue