You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
chore: refactor code
pass only the mxEvent object to ViewSource derive the necessary values inside the component
This commit is contained in:
@ -124,16 +124,9 @@ export default class MessageContextMenu extends React.Component {
|
||||
};
|
||||
|
||||
onViewSourceClick = () => {
|
||||
const ev = this.props.mxEvent.replacingEvent() || this.props.mxEvent;
|
||||
const ViewSource = sdk.getComponent('structures.ViewSource');
|
||||
Modal.createTrackedDialog('View Event Source', '', ViewSource, {
|
||||
roomId: ev.getRoomId(),
|
||||
eventId: ev.getId(),
|
||||
content: ev.event,
|
||||
event: ev,
|
||||
isEncrypted: this.props.mxEvent.getType() !== this.props.mxEvent.getWireType(),
|
||||
// FIXME: _clearEvent is private
|
||||
decryptedContent: ev._clearEvent,
|
||||
mxEvent: this.props.mxEvent,
|
||||
}, 'mx_Dialog_viewsource');
|
||||
this.closeMenu();
|
||||
};
|
||||
|
Reference in New Issue
Block a user