mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 14:05:04 +08:00
switch badge count to per-conversation, and add per-room badges
This commit is contained in:
parent
5bde32f7fe
commit
fd09d5c570
@ -999,9 +999,12 @@ module.exports = React.createClass({
|
||||
var rooms = MatrixClientPeg.get().getRooms();
|
||||
for (var i = 0; i < rooms.length; ++i) {
|
||||
if (rooms[i].hasMembershipState(MatrixClientPeg.get().credentials.userId, 'invite')) {
|
||||
++notifCount;
|
||||
notifCount++;
|
||||
} else if (rooms[i].getUnreadNotificationCount()) {
|
||||
notifCount += rooms[i].getUnreadNotificationCount();
|
||||
// if we were summing unread notifs:
|
||||
// notifCount += rooms[i].getUnreadNotificationCount();
|
||||
// instead, we just count the number of rooms with notifs.
|
||||
notifCount++;
|
||||
}
|
||||
}
|
||||
try {
|
||||
|
@ -83,7 +83,7 @@ module.exports = React.createClass({
|
||||
name = name.replace(":", ":\u200b"); // add a zero-width space to allow linewrapping after the colon
|
||||
var badge;
|
||||
if (this.props.highlight || notificationCount > 0) {
|
||||
badge = <div className="mx_RoomTile_badge"/>;
|
||||
badge = <div className="mx_RoomTile_badge">{ notificationCount ? notificationCount : '!' }</div>;
|
||||
}
|
||||
/*
|
||||
if (this.props.highlight) {
|
||||
@ -132,9 +132,9 @@ module.exports = React.createClass({
|
||||
<div className={classes} onClick={this.onClick} onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}>
|
||||
<div className="mx_RoomTile_avatar">
|
||||
<RoomAvatar room={this.props.room} width={24} height={24} />
|
||||
{ badge }
|
||||
</div>
|
||||
{ label }
|
||||
{ badge }
|
||||
{ incomingCallBox }
|
||||
</div>
|
||||
));
|
||||
|
Loading…
Reference in New Issue
Block a user