Fix notification minus count
authorAjay Bura <ajbura@gmail.com>
Wed, 27 Oct 2021 10:33:41 +0000 (16:03 +0530)
committerAjay Bura <ajbura@gmail.com>
Wed, 27 Oct 2021 10:33:41 +0000 (16:03 +0530)
Signed-off-by: Ajay Bura <ajbura@gmail.com>
src/client/state/Notifications.js

index f5ecce2b51c6c15b1dc690812bef828ba899c4e2..b5ba4e04cf7e49cc7a05da6eb7544634eb18fff9 100644 (file)
@@ -103,6 +103,10 @@ class Notifications extends EventEmitter {
     const prevTotal = noti.total;
     noti.total -= total;
     noti.highlight -= highlight;
+    if (noti.total < 0) {
+      noti.total = 0;
+      noti.highlight = 0;
+    }
     if (childId && noti.from !== null) {
       noti.from.delete(childId);
     }