Fix bold rooms not bolding
This commit is contained in:
parent
e8c33161ec
commit
c37352679d
1 changed files with 3 additions and 1 deletions
|
@ -42,6 +42,7 @@ interface IProps {
|
||||||
interface IBadgeState {
|
interface IBadgeState {
|
||||||
showBadge: boolean; // if numUnread > 0 && !showBadge -> bold room
|
showBadge: boolean; // if numUnread > 0 && !showBadge -> bold room
|
||||||
numUnread: number; // used only if showBadge or showBadgeHighlight is true
|
numUnread: number; // used only if showBadge or showBadgeHighlight is true
|
||||||
|
hasUnread: number; // used to make the room bold
|
||||||
showBadgeHighlight: boolean; // make the badge red
|
showBadgeHighlight: boolean; // make the badge red
|
||||||
isInvite: boolean; // show a `!` instead of a number
|
isInvite: boolean; // show a `!` instead of a number
|
||||||
}
|
}
|
||||||
|
@ -98,6 +99,7 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
|
||||||
return {
|
return {
|
||||||
showBadge: (showBadge && shouldShowNotifBadge) || isInvite,
|
showBadge: (showBadge && shouldShowNotifBadge) || isInvite,
|
||||||
numUnread,
|
numUnread,
|
||||||
|
hasUnread: showBadge,
|
||||||
showBadgeHighlight: (highlightCount > 0 && shouldShowHighlightBadge) || isInvite,
|
showBadgeHighlight: (highlightCount > 0 && shouldShowHighlightBadge) || isInvite,
|
||||||
isInvite,
|
isInvite,
|
||||||
};
|
};
|
||||||
|
@ -130,7 +132,7 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
|
||||||
const classes = classNames({
|
const classes = classNames({
|
||||||
'mx_RoomTile': true,
|
'mx_RoomTile': true,
|
||||||
// 'mx_RoomTile_selected': this.state.selected,
|
// 'mx_RoomTile_selected': this.state.selected,
|
||||||
'mx_RoomTile_unread': this.state.numUnread > 0,
|
'mx_RoomTile_unread': this.state.numUnread > 0 || this.state.hasUnread,
|
||||||
'mx_RoomTile_unreadNotify': this.state.showBadge,
|
'mx_RoomTile_unreadNotify': this.state.showBadge,
|
||||||
'mx_RoomTile_highlight': this.state.showBadgeHighlight,
|
'mx_RoomTile_highlight': this.state.showBadgeHighlight,
|
||||||
'mx_RoomTile_invited': this.state.isInvite,
|
'mx_RoomTile_invited': this.state.isInvite,
|
||||||
|
|
Loading…
Reference in a new issue