Refactor 2194cb65a2b54afd6673c78a71d8d298dc94ccdf
authorAjay Bura <ajbura@gmail.com>
Fri, 29 Oct 2021 07:50:27 +0000 (13:20 +0530)
committerAjay Bura <ajbura@gmail.com>
Fri, 29 Oct 2021 07:50:27 +0000 (13:20 +0530)
Signed-off-by: Ajay Bura <ajbura@gmail.com>
src/app/organisms/navigation/SideBar.jsx

index 82432595766cb21cea61c68a6b679608723f1da5..35fe8f2e8645a9452d15e59cb1cf13a4e472f957 100644 (file)
@@ -121,19 +121,13 @@ function SideBar() {
     let noti = null;
 
     orphans.forEach((roomId) => {
+      if (roomList.spaceShortcut.has(roomId)) return;
       if (!notifications.hasNoti(roomId)) return;
       if (noti === null) noti = { total: 0, highlight: 0 };
       const childNoti = notifications.getNoti(roomId);
       noti.total += childNoti.total;
       noti.highlight += childNoti.highlight;
     });
-    if (noti === null) return noti;
-
-    [...roomList.spaceShortcut].forEach((spaceId) => {
-      const shortcutNoti = notifications.getNoti(spaceId);
-      noti.total -= shortcutNoti.total;
-      noti.highlight -= shortcutNoti.highlight;
-    });
 
     return noti;
   }