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

Commit 4823794

Browse files
committed
Only aggregate DM notifications on the Space Panel in the Home Space
1 parent feac025 commit 4823794

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
@@ -406,7 +406,19 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
406406

407407
this.spaceFilteredRooms.forEach((roomIds, s) => {
408408
// Update NotificationStates
409-
this.getNotificationState(s)?.setRooms(visibleRooms.filter(room => roomIds.has(room.roomId)));
409+
this.getNotificationState(s)?.setRooms(visibleRooms.filter(room => {
410+
if (roomIds.has(room.roomId)) {
411+
// Don't aggregate notifications for DMs except in the Home Space
412+
if (s !== HOME_SPACE) {
413+
return !DMRoomMap.shared().getUserIdForRoomId(room.roomId)
414+
|| RoomListStore.instance.getTagsForRoom(room).includes(DefaultTagID.Favourite);
415+
}
416+
417+
return true;
418+
}
419+
420+
return false;
421+
}));
410422
});
411423
}, 100, {trailing: true, leading: true});
412424

0 commit comments

Comments
 (0)