chore: refactor code

pass only the mxEvent object to ViewSource
derive the necessary values inside the component
This commit is contained in:
Panagiotis 2021-03-06 11:30:31 +02:00
parent ed6486aabb
commit 51ac5421c9
3 changed files with 86 additions and 90 deletions

View file

@ -74,11 +74,7 @@ export default class EditHistoryMessage extends React.PureComponent {
_onViewSourceClick = () => {
const ViewSource = sdk.getComponent('structures.ViewSource');
Modal.createTrackedDialog('View Event Source', 'Edit history', ViewSource, {
roomId: this.props.mxEvent.getRoomId(),
eventId: this.props.mxEvent.getId(),
content: this.props.mxEvent.event,
isEncrypted: this.props.mxEvent.getType() !== this.props.mxEvent.getWireType(),
decryptedContent: this.props.mxEvent._clearEvent,
mxEvent: this.props.mxEvent,
}, 'mx_Dialog_viewsource');
};