mirror of
https://github.com/element-hq/element-web
synced 2024-11-22 17:25:50 +03:00
Fix room tile badge not disappearing when receiving a read receipt
Fixes https://github.com/vector-im/riot-web/issues/6357
This commit is contained in:
parent
12e468a314
commit
f0b130a04b
1 changed files with 9 additions and 0 deletions
|
@ -146,6 +146,15 @@ module.exports = React.createClass({
|
|||
dis.unregister(this.dispatcherRef);
|
||||
},
|
||||
|
||||
componentWillReceiveProps: function(props) {
|
||||
// XXX: This could be a lot better - this makes the assumption that
|
||||
// the notification count may have changed when the properties of
|
||||
// the room tile change.
|
||||
this.setState({
|
||||
notificationCount: this.props.room.getUnreadNotificationCount(),
|
||||
});
|
||||
},
|
||||
|
||||
// Do a simple shallow comparison of props and state to avoid unnecessary
|
||||
// renders. The assumption made here is that only state and props are used
|
||||
// in rendering this component and children.
|
||||
|
|
Loading…
Reference in a new issue