mirror of https://github.com/vector-im/riot-web
fix two room list regressions:
+ missing roomsublist badge for invites + missing room badge for invites if i18n!=English Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/4907/head
parent
65f0bd04f2
commit
1c387c1fd1
|
@ -78,6 +78,9 @@ var RoomSubList = React.createClass({
|
||||||
// undefined if no room is selected (eg we are showing settings)
|
// undefined if no room is selected (eg we are showing settings)
|
||||||
selectedRoom: React.PropTypes.string,
|
selectedRoom: React.PropTypes.string,
|
||||||
|
|
||||||
|
// pass explicitly, do not rely on label==='Invites' because i18n.
|
||||||
|
isInvite: React.PropTypes.bool,
|
||||||
|
|
||||||
startAsHidden: React.PropTypes.bool,
|
startAsHidden: React.PropTypes.bool,
|
||||||
showSpinner: React.PropTypes.bool, // true to show a spinner if 0 elements when expanded
|
showSpinner: React.PropTypes.bool, // true to show a spinner if 0 elements when expanded
|
||||||
collapsed: React.PropTypes.bool.isRequired, // is LeftPanel collapsed?
|
collapsed: React.PropTypes.bool.isRequired, // is LeftPanel collapsed?
|
||||||
|
@ -246,7 +249,7 @@ var RoomSubList = React.createClass({
|
||||||
return this.props.list.reduce(function(result, room, index) {
|
return this.props.list.reduce(function(result, room, index) {
|
||||||
if (truncateAt === undefined || index >= truncateAt) {
|
if (truncateAt === undefined || index >= truncateAt) {
|
||||||
var roomNotifState = RoomNotifs.getRoomNotifsState(room.roomId);
|
var roomNotifState = RoomNotifs.getRoomNotifsState(room.roomId);
|
||||||
var highlight = room.getUnreadNotificationCount('highlight') > 0 || self.props.label === 'Invites';
|
var highlight = room.getUnreadNotificationCount('highlight') > 0 || self.props.isInvite;
|
||||||
var notificationCount = room.getUnreadNotificationCount();
|
var notificationCount = room.getUnreadNotificationCount();
|
||||||
|
|
||||||
const notifBadges = notificationCount > 0 && self._shouldShowNotifBadge(roomNotifState);
|
const notifBadges = notificationCount > 0 && self._shouldShowNotifBadge(roomNotifState);
|
||||||
|
@ -376,8 +379,8 @@ var RoomSubList = React.createClass({
|
||||||
collapsed={ self.props.collapsed || false}
|
collapsed={ self.props.collapsed || false}
|
||||||
selected={ selected }
|
selected={ selected }
|
||||||
unread={ Unread.doesRoomHaveUnreadMessages(room) }
|
unread={ Unread.doesRoomHaveUnreadMessages(room) }
|
||||||
highlight={ room.getUnreadNotificationCount('highlight') > 0 || self.props.label === 'Invites' }
|
highlight={ room.getUnreadNotificationCount('highlight') > 0 || self.props.isInvite }
|
||||||
isInvite={ self.props.label === 'Invites' }
|
isInvite={ self.props.isInvite }
|
||||||
refreshSubList={ self._updateSubListCount }
|
refreshSubList={ self._updateSubListCount }
|
||||||
incomingCall={ null }
|
incomingCall={ null }
|
||||||
onClick={ self.onRoomTileClick }
|
onClick={ self.onRoomTileClick }
|
||||||
|
@ -409,6 +412,9 @@ var RoomSubList = React.createClass({
|
||||||
var badge;
|
var badge;
|
||||||
if (subListNotifCount > 0) {
|
if (subListNotifCount > 0) {
|
||||||
badge = <div className={badgeClasses}>{ FormattingUtils.formatCount(subListNotifCount) }</div>;
|
badge = <div className={badgeClasses}>{ FormattingUtils.formatCount(subListNotifCount) }</div>;
|
||||||
|
} else if (this.props.isInvite) {
|
||||||
|
// no notifications but highlight anyway because this is an invite badge
|
||||||
|
badge = <div className={badgeClasses}>!</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// When collapsed, allow a long hover on the header to show user
|
// When collapsed, allow a long hover on the header to show user
|
||||||
|
|
Loading…
Reference in New Issue