chore: refactor code
pass only the mxEvent object to ViewSource derive the necessary values inside the component
This commit is contained in:
parent
ed6486aabb
commit
51ac5421c9
3 changed files with 86 additions and 90 deletions
|
@ -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();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue