Ignore unreads in low priority rooms in the space panel (#6518)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>pull/28788/head^2
parent
488babaf65
commit
3bf52fc110
|
@ -21,6 +21,8 @@ import { arrayDiff } from "../../utils/arrays";
|
||||||
import { RoomNotificationState } from "./RoomNotificationState";
|
import { RoomNotificationState } from "./RoomNotificationState";
|
||||||
import { NotificationState, NotificationStateEvents } from "./NotificationState";
|
import { NotificationState, NotificationStateEvents } from "./NotificationState";
|
||||||
import { FetchRoomFn } from "./ListNotificationState";
|
import { FetchRoomFn } from "./ListNotificationState";
|
||||||
|
import { DefaultTagID } from "../room-list/models";
|
||||||
|
import RoomListStore from "../room-list/RoomListStore";
|
||||||
|
|
||||||
export class SpaceNotificationState extends NotificationState {
|
export class SpaceNotificationState extends NotificationState {
|
||||||
public rooms: Room[] = []; // exposed only for tests
|
public rooms: Room[] = []; // exposed only for tests
|
||||||
|
@ -74,7 +76,15 @@ export class SpaceNotificationState extends NotificationState {
|
||||||
|
|
||||||
this._count = 0;
|
this._count = 0;
|
||||||
this._color = NotificationColor.None;
|
this._color = NotificationColor.None;
|
||||||
for (const state of Object.values(this.states)) {
|
for (const [roomId, state] of Object.entries(this.states)) {
|
||||||
|
const roomTags = RoomListStore.instance.getTagsForRoom(this.rooms.find(r => r.roomId === roomId));
|
||||||
|
|
||||||
|
// We ignore unreads in LowPriority rooms, see https://github.com/vector-im/element-web/issues/16836
|
||||||
|
if (
|
||||||
|
roomTags.includes(DefaultTagID.LowPriority) &&
|
||||||
|
state.color === NotificationColor.Bold
|
||||||
|
) continue;
|
||||||
|
|
||||||
this._count += state.count;
|
this._count += state.count;
|
||||||
this._color = Math.max(this.color, state.color);
|
this._color = Math.max(this.color, state.color);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue