mirror of
https://github.com/element-hq/element-web
synced 2024-11-26 19:26:04 +03:00
Fix the permagrey local-echo bug
This commit is contained in:
parent
e5a4e5b195
commit
2355d5e6b5
2 changed files with 19 additions and 1 deletions
|
@ -54,7 +54,11 @@ module.exports = {
|
|||
};
|
||||
}
|
||||
|
||||
MatrixClientPeg.get().sendMessage(this.props.roomId, content);
|
||||
MatrixClientPeg.get().sendMessage(this.props.roomId, content).then(function() {
|
||||
dis.dispatch({
|
||||
action: 'message_sent'
|
||||
});
|
||||
});
|
||||
this.refs.textarea.getDOMNode().value = '';
|
||||
ev.preventDefault();
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ limitations under the License.
|
|||
|
||||
var MatrixClientPeg = require("../../MatrixClientPeg");
|
||||
|
||||
var dis = require("../../dispatcher");
|
||||
|
||||
var PAGINATE_SIZE = 20;
|
||||
|
||||
module.exports = {
|
||||
|
@ -28,16 +30,28 @@ module.exports = {
|
|||
},
|
||||
|
||||
componentWillMount: function() {
|
||||
this.dispatcherRef = dis.register(this.onAction);
|
||||
MatrixClientPeg.get().on("Room.timeline", this.onRoomTimeline);
|
||||
this.atBottom = true;
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
dis.unregister(this.dispatcherRef);
|
||||
if (MatrixClientPeg.get()) {
|
||||
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
|
||||
}
|
||||
},
|
||||
|
||||
onAction: function(payload) {
|
||||
switch (payload.action) {
|
||||
case 'message_sent':
|
||||
this.setState({
|
||||
room: MatrixClientPeg.get().getRoom(this.props.roomId)
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
// MatrixRoom still showing the messages from the old room?
|
||||
// Set the key to the room_id. Sadly you can no longer get at
|
||||
// the key from inside the component, or we'd check this in code.
|
||||
|
|
Loading…
Reference in a new issue