1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-05 23:10:41 +03:00

support resending edit in context menu

This commit is contained in:
Bruno Windels
2019-06-27 17:41:47 +02:00
parent 1af8da4a4a
commit 6d458154a9
2 changed files with 16 additions and 0 deletions

View File

@@ -90,6 +90,11 @@ module.exports = React.createClass({
this.closeMenu();
},
onResendEditClick: function() {
Resend.resend(this.props.mxEvent.replacingEvent());
this.closeMenu();
},
e2eInfoClicked: function() {
this.props.e2eInfoCallback();
this.closeMenu();
@@ -220,6 +225,8 @@ module.exports = React.createClass({
render: function() {
const mxEvent = this.props.mxEvent;
const eventStatus = mxEvent.status;
const editEvent = mxEvent.replacingEvent();
const editStatus = editEvent && editEvent.status;
let resendButton;
let redactButton;
let cancelButton;
@@ -242,6 +249,14 @@ module.exports = React.createClass({
);
}
if (editStatus === EventStatus.NOT_SENT) {
resendButton = (
<div className="mx_MessageContextMenu_field" onClick={this.onResendEditClick}>
{ _t('Resend edit') }
</div>
);
}
if (isSent && this.state.canRedact) {
redactButton = (
<div className="mx_MessageContextMenu_field" onClick={this.onRedactClick}>