Skip to content

Commit 1c387c1

Browse files
committed
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>
1 parent 65f0bd0 commit 1c387c1

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎src/components/structures/RoomSubList.js‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ var RoomSubList = React.createClass({
7878
// undefined if no room is selected (eg we are showing settings)
7979
selectedRoom: React.PropTypes.string,
8080

81+
// pass explicitly, do not rely on label==='Invites' because i18n.
82+
isInvite: React.PropTypes.bool,
83+
8184
startAsHidden: React.PropTypes.bool,
8285
showSpinner: React.PropTypes.bool, // true to show a spinner if 0 elements when expanded
8386
collapsed: React.PropTypes.bool.isRequired, // is LeftPanel collapsed?
@@ -246,7 +249,7 @@ var RoomSubList = React.createClass({
246249
return this.props.list.reduce(function(result, room, index) {
247250
if (truncateAt === undefined || index >= truncateAt) {
248251
var roomNotifState = RoomNotifs.getRoomNotifsState(room.roomId);
249-
var highlight = room.getUnreadNotificationCount('highlight') > 0 || self.props.label === 'Invites';
252+
var highlight = room.getUnreadNotificationCount('highlight') > 0 || self.props.isInvite;
250253
var notificationCount = room.getUnreadNotificationCount();
251254

252255
const notifBadges = notificationCount > 0 && self._shouldShowNotifBadge(roomNotifState);
@@ -376,8 +379,8 @@ var RoomSubList = React.createClass({
376379
collapsed={ self.props.collapsed || false}
377380
selected={ selected }
378381
unread={ Unread.doesRoomHaveUnreadMessages(room) }
379-
highlight={ room.getUnreadNotificationCount('highlight') > 0 || self.props.label === 'Invites' }
380-
isInvite={ self.props.label === 'Invites' }
382+
highlight={ room.getUnreadNotificationCount('highlight') > 0 || self.props.isInvite }
383+
isInvite={ self.props.isInvite }
381384
refreshSubList={ self._updateSubListCount }
382385
incomingCall={ null }
383386
onClick={ self.onRoomTileClick }
@@ -409,6 +412,9 @@ var RoomSubList = React.createClass({
409412
var badge;
410413
if (subListNotifCount > 0) {
411414
badge = <div className={badgeClasses}>{ FormattingUtils.formatCount(subListNotifCount) }</div>;
415+
} else if (this.props.isInvite) {
416+
// no notifications but highlight anyway because this is an invite badge
417+
badge = <div className={badgeClasses}>!</div>;
412418
}
413419

414420
// When collapsed, allow a long hover on the header to show user

0 commit comments

Comments
 (0)