Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 3bf52fc

Browse files
Ignore unreads in low priority rooms in the space panel (#6518)
Co-authored-by: Michael Telatynski <[email protected]>
1 parent 488baba commit 3bf52fc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/stores/notifications/SpaceNotificationState.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import { arrayDiff } from "../../utils/arrays";
2121
import { RoomNotificationState } from "./RoomNotificationState";
2222
import { NotificationState, NotificationStateEvents } from "./NotificationState";
2323
import { FetchRoomFn } from "./ListNotificationState";
24+
import { DefaultTagID } from "../room-list/models";
25+
import RoomListStore from "../room-list/RoomListStore";
2426

2527
export class SpaceNotificationState extends NotificationState {
2628
public rooms: Room[] = []; // exposed only for tests
@@ -74,7 +76,15 @@ export class SpaceNotificationState extends NotificationState {
7476

7577
this._count = 0;
7678
this._color = NotificationColor.None;
77-
for (const state of Object.values(this.states)) {
79+
for (const [roomId, state] of Object.entries(this.states)) {
80+
const roomTags = RoomListStore.instance.getTagsForRoom(this.rooms.find(r => r.roomId === roomId));
81+
82+
// We ignore unreads in LowPriority rooms, see https://github.com/vector-im/element-web/issues/16836
83+
if (
84+
roomTags.includes(DefaultTagID.LowPriority) &&
85+
state.color === NotificationColor.Bold
86+
) continue;
87+
7888
this._count += state.count;
7989
this._color = Math.max(this.color, state.color);
8090
}

0 commit comments

Comments
 (0)