Navigate to room with maximum notifications when clicked on already selected space

This commit is contained in:
Jaiwanth 2021-05-05 12:38:44 +05:30
parent 2bf931b9d3
commit 73b9ad41da
2 changed files with 18 additions and 2 deletions

View file

@ -53,6 +53,11 @@ export class SpaceNotificationState extends NotificationState {
this.calculateTotalState();
}
public getRoomWithMaxNotifications() {
return this.rooms.reduce((prev, curr) =>
(prev._notificationCounts.total > curr._notificationCounts.total ? prev : curr)).roomId;
}
public destroy() {
super.destroy();
for (const state of Object.values(this.states)) {