From 6baf405a05407fab79e939d30f3f254e11c84ae9 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 15 Oct 2015 14:09:19 +0100 Subject: [PATCH] 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. --- src/controllers/molecules/MessageTile.js | 16 ---------------- src/controllers/organisms/RoomView.js | 1 + 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/controllers/molecules/MessageTile.js b/src/controllers/molecules/MessageTile.js index 47b616e724..4a7ce7e1df 100644 --- a/src/controllers/molecules/MessageTile.js +++ b/src/controllers/molecules/MessageTile.js @@ -29,22 +29,6 @@ module.exports = { return { 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 - }); - }) } }; diff --git a/src/controllers/organisms/RoomView.js b/src/controllers/organisms/RoomView.js index ea84746bab..8ca2d7233b 100644 --- a/src/controllers/organisms/RoomView.js +++ b/src/controllers/organisms/RoomView.js @@ -67,6 +67,7 @@ module.exports = { switch (payload.action) { case 'message_send_failed': case 'message_sent': + case 'message_resend_started': this.setState({ room: MatrixClientPeg.get().getRoom(this.props.roomId) });