parent
8743af56ad
commit
61618d5162
|
@ -56,10 +56,11 @@ export function countRoomsWithNotif(rooms) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function aggregateNotificationCount(rooms) {
|
export function aggregateNotificationCount(rooms) {
|
||||||
return rooms.reduce((result, room, index) => {
|
return rooms.reduce((result, room) => {
|
||||||
const roomNotifState = getRoomNotifsState(room.roomId);
|
const roomNotifState = getRoomNotifsState(room.roomId);
|
||||||
const highlight = room.getUnreadNotificationCount('highlight') > 0;
|
const highlight = room.getUnreadNotificationCount('highlight') > 0;
|
||||||
const notificationCount = room.getUnreadNotificationCount();
|
// use helper method to include highlights in the previous version of the room
|
||||||
|
const notificationCount = getUnreadNotificationCount(room);
|
||||||
|
|
||||||
const notifBadges = notificationCount > 0 && shouldShowNotifBadge(roomNotifState);
|
const notifBadges = notificationCount > 0 && shouldShowNotifBadge(roomNotifState);
|
||||||
const mentionBadges = highlight && shouldShowMentionBadge(roomNotifState);
|
const mentionBadges = highlight && shouldShowMentionBadge(roomNotifState);
|
||||||
|
|
|
@ -1828,7 +1828,9 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateStatusIndicator(state: string, prevState: string) {
|
updateStatusIndicator(state: string, prevState: string) {
|
||||||
const notifCount = countRoomsWithNotif(MatrixClientPeg.get().getRooms()).count;
|
// only count visible rooms to not torment the user with notification counts in rooms they can't see
|
||||||
|
// it will include highlights from the previous version of the room internally
|
||||||
|
const notifCount = countRoomsWithNotif(MatrixClientPeg.get().getVisibleRooms()).count;
|
||||||
|
|
||||||
if (PlatformPeg.get()) {
|
if (PlatformPeg.get()) {
|
||||||
PlatformPeg.get().setErrorStatus(state === 'ERROR');
|
PlatformPeg.get().setErrorStatus(state === 'ERROR');
|
||||||
|
|
Loading…
Reference in New Issue