Fix cleaning unread state on room select & ignore our own messages

pull/1/head
David Baker 2015-06-18 14:40:55 +01:00
parent 7c405f673a
commit 90f6764cbf
1 changed files with 3 additions and 2 deletions

View File

@ -23,8 +23,8 @@ module.exports = React.createClass({
}
},
componentWillReceiveProps: function() {
this.state.activityMap[this.props.selectedRoom] = undefined;
componentWillReceiveProps: function(newProps) {
this.state.activityMap[newProps.selectedRoom] = undefined;
this.setState({
activityMap: this.state.activityMap
});
@ -32,6 +32,7 @@ module.exports = React.createClass({
onRoomTimeline: function(ev, room, toStartOfTimeline) {
if (room.roomId == this.props.selectedRoom) return;
if (ev.getSender() == MatrixClientPeg.get().credentials.userId) return;
// obviously this won't deep copy but we this shouldn't be necessary
var amap = this.state.activityMap;