Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Prevent team member message and mention count to go below 0 (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
enahum authored and hmhealey committed Aug 28, 2020
1 parent 5115975 commit b5d8ad0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/mattermost-redux/src/reducers/entities/teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ function myMembers(state = {}, action) {
const nextState = {...state};
const unreads = action.data;
for (const u of unreads) {
const msgCount = u.msg_count < 0 ? 0 : u.msg_count;
const mentionCount = u.mention_count < 0 ? 0 : u.mention_count;
const m = {
...state[u.team_id],
mention_count: u.mention_count,
msg_count: u.msg_count
mention_count: mentionCount,
msg_count: msgCount
};
nextState[u.team_id] = m;
}
Expand Down

0 comments on commit b5d8ad0

Please sign in to comment.