Remove the 'resending' state which was duplicating a property of the event itself for no obvious reason. Remove onResend whose purpose was mostly to manage that state (and really should have been 'onResendClicked'). Listen for action to see when a message is resent.
This commit is contained in:
parent
02a2e06d52
commit
6baf405a05
2 changed files with 1 additions and 16 deletions
|
@ -29,22 +29,6 @@ module.exports = {
|
||||||
return {
|
return {
|
||||||
resending: false
|
resending: false
|
||||||
};
|
};
|
||||||
},
|
|
||||||
|
|
||||||
onResend: function() {
|
|
||||||
var self = this;
|
|
||||||
self.setState({
|
|
||||||
resending: true
|
|
||||||
});
|
|
||||||
MatrixClientPeg.get().resendEvent(
|
|
||||||
this.props.mxEvent, MatrixClientPeg.get().getRoom(
|
|
||||||
this.props.mxEvent.getRoomId()
|
|
||||||
)
|
|
||||||
).finally(function() {
|
|
||||||
self.setState({
|
|
||||||
resending: false
|
|
||||||
});
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@ module.exports = {
|
||||||
switch (payload.action) {
|
switch (payload.action) {
|
||||||
case 'message_send_failed':
|
case 'message_send_failed':
|
||||||
case 'message_sent':
|
case 'message_sent':
|
||||||
|
case 'message_resend_started':
|
||||||
this.setState({
|
this.setState({
|
||||||
room: MatrixClientPeg.get().getRoom(this.props.roomId)
|
room: MatrixClientPeg.get().getRoom(this.props.roomId)
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue