summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
Diffstat (limited to 'webapp')
-rw-r--r--webapp/stores/team_store.jsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/webapp/stores/team_store.jsx b/webapp/stores/team_store.jsx
index 1601a684a..6f81a9345 100644
--- a/webapp/stores/team_store.jsx
+++ b/webapp/stores/team_store.jsx
@@ -324,8 +324,11 @@ class TeamStoreClass extends EventEmitter {
subtractUnread(teamId, msgs, mentions) {
const member = this.my_team_members.filter((m) => m.team_id === teamId)[0];
if (member) {
- member.msg_count -= msgs;
- member.mention_count -= mentions;
+ const msgCount = member.msg_count - msgs;
+ const mentionCount = member.mention_count - mentions;
+
+ member.msg_count = (msgCount > 0) ? msgCount : 0;
+ member.mention_count = (mentionCount > 0) ? mentionCount : 0;
}
}