Merge pull request #5968 from matrix-org/t3chguy/fix/17044

Only aggregate DM notifications on the Space Panel in the Home Space
This commit is contained in:
Michael Telatynski 2021-05-05 16:35:07 +01:00 committed by GitHub
commit 01fa25f3fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -413,7 +413,19 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
this.spaceFilteredRooms.forEach((roomIds, s) => {
// Update NotificationStates
this.getNotificationState(s)?.setRooms(visibleRooms.filter(room => roomIds.has(room.roomId)));
this.getNotificationState(s)?.setRooms(visibleRooms.filter(room => {
if (roomIds.has(room.roomId)) {
// Don't aggregate notifications for DMs except in the Home Space
if (s !== HOME_SPACE) {
return !DMRoomMap.shared().getUserIdForRoomId(room.roomId)
|| RoomListStore.instance.getTagsForRoom(room).includes(DefaultTagID.Favourite);
}
return true;
}
return false;
}));
});
}, 100, {trailing: true, leading: true});