Merge pull request #4571 from matrix-org/t3chguy/view_source_edits
View Source should target the replacing event rather than the root one
This commit is contained in:
commit
aacc582b52
1 changed files with 8 additions and 6 deletions
|
@ -130,22 +130,24 @@ export default createReactClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onViewSourceClick: function() {
|
onViewSourceClick: function() {
|
||||||
|
const ev = this.props.mxEvent.replacingEvent() || this.props.mxEvent;
|
||||||
const ViewSource = sdk.getComponent('structures.ViewSource');
|
const ViewSource = sdk.getComponent('structures.ViewSource');
|
||||||
Modal.createTrackedDialog('View Event Source', '', ViewSource, {
|
Modal.createTrackedDialog('View Event Source', '', ViewSource, {
|
||||||
roomId: this.props.mxEvent.getRoomId(),
|
roomId: ev.getRoomId(),
|
||||||
eventId: this.props.mxEvent.getId(),
|
eventId: ev.getId(),
|
||||||
content: this.props.mxEvent.event,
|
content: ev.event,
|
||||||
}, 'mx_Dialog_viewsource');
|
}, 'mx_Dialog_viewsource');
|
||||||
this.closeMenu();
|
this.closeMenu();
|
||||||
},
|
},
|
||||||
|
|
||||||
onViewClearSourceClick: function() {
|
onViewClearSourceClick: function() {
|
||||||
|
const ev = this.props.mxEvent.replacingEvent() || this.props.mxEvent;
|
||||||
const ViewSource = sdk.getComponent('structures.ViewSource');
|
const ViewSource = sdk.getComponent('structures.ViewSource');
|
||||||
Modal.createTrackedDialog('View Clear Event Source', '', ViewSource, {
|
Modal.createTrackedDialog('View Clear Event Source', '', ViewSource, {
|
||||||
roomId: this.props.mxEvent.getRoomId(),
|
roomId: ev.getRoomId(),
|
||||||
eventId: this.props.mxEvent.getId(),
|
eventId: ev.getId(),
|
||||||
// FIXME: _clearEvent is private
|
// FIXME: _clearEvent is private
|
||||||
content: this.props.mxEvent._clearEvent,
|
content: ev._clearEvent,
|
||||||
}, 'mx_Dialog_viewsource');
|
}, 'mx_Dialog_viewsource');
|
||||||
this.closeMenu();
|
this.closeMenu();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue