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

Commit 01fa25f

Browse files
authored
Merge pull request #5968 from matrix-org/t3chguy/fix/17044
Only aggregate DM notifications on the Space Panel in the Home Space
2 parents 7cae566 + 4823794 commit 01fa25f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/stores/SpaceStore.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,19 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
413413

414414
this.spaceFilteredRooms.forEach((roomIds, s) => {
415415
// Update NotificationStates
416-
this.getNotificationState(s)?.setRooms(visibleRooms.filter(room => roomIds.has(room.roomId)));
416+
this.getNotificationState(s)?.setRooms(visibleRooms.filter(room => {
417+
if (roomIds.has(room.roomId)) {
418+
// Don't aggregate notifications for DMs except in the Home Space
419+
if (s !== HOME_SPACE) {
420+
return !DMRoomMap.shared().getUserIdForRoomId(room.roomId)
421+
|| RoomListStore.instance.getTagsForRoom(room).includes(DefaultTagID.Favourite);
422+
}
423+
424+
return true;
425+
}
426+
427+
return false;
428+
}));
417429
});
418430
}, 100, {trailing: true, leading: true});
419431

0 commit comments

Comments
 (0)