Fix notification minus count

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2021-10-27 16:03:41 +05:30
parent aca2c3a9dd
commit 603d373cee

View 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);
}