From: Ajay Bura Date: Wed, 27 Oct 2021 10:33:41 +0000 (+0530) Subject: Fix notification minus count X-Git-Tag: v1.5.0~26 X-Git-Url: https://git.wafflesoft.org/?a=commitdiff_plain;h=603d373cee5f2919ec87cb1548b2d306bbfe7459;p=cinny.git Fix notification minus count Signed-off-by: Ajay Bura --- diff --git a/src/client/state/Notifications.js b/src/client/state/Notifications.js index f5ecce2..b5ba4e0 100644 --- a/src/client/state/Notifications.js +++ b/src/client/state/Notifications.js @@ -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); }