Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit f0b130a

Browse files
lukebarnard1dbkr
authored andcommitted
Fix room tile badge not disappearing when receiving a read receipt
Fixes element-hq/element-web#6357
1 parent 12e468a commit f0b130a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/components/views/rooms/RoomTile.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ module.exports = React.createClass({
146146
dis.unregister(this.dispatcherRef);
147147
},
148148

149+
componentWillReceiveProps: function(props) {
150+
// XXX: This could be a lot better - this makes the assumption that
151+
// the notification count may have changed when the properties of
152+
// the room tile change.
153+
this.setState({
154+
notificationCount: this.props.room.getUnreadNotificationCount(),
155+
});
156+
},
157+
149158
// Do a simple shallow comparison of props and state to avoid unnecessary
150159
// renders. The assumption made here is that only state and props are used
151160
// in rendering this component and children.

0 commit comments

Comments
 (0)