Prevent msg count subtraction to be less than zero (#5565)
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
daef8d8384
Коммит
551adddb67
@@ -324,8 +324,11 @@ class TeamStoreClass extends EventEmitter {
|
|||||||
subtractUnread(teamId, msgs, mentions) {
|
subtractUnread(teamId, msgs, mentions) {
|
||||||
const member = this.my_team_members.filter((m) => m.team_id === teamId)[0];
|
const member = this.my_team_members.filter((m) => m.team_id === teamId)[0];
|
||||||
if (member) {
|
if (member) {
|
||||||
member.msg_count -= msgs;
|
const msgCount = member.msg_count - msgs;
|
||||||
member.mention_count -= mentions;
|
const mentionCount = member.mention_count - mentions;
|
||||||
|
|
||||||
|
member.msg_count = (msgCount > 0) ? msgCount : 0;
|
||||||
|
member.mention_count = (mentionCount > 0) ? mentionCount : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user