PLT-5396 Fix team mention badge persistance (#5543)
Этот коммит содержится в:
@@ -55,6 +55,10 @@ export function emitChannelClickEvent(channel) {
|
|||||||
loadPosts(chan.id);
|
loadPosts(chan.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Subtract mentions for the team
|
||||||
|
const {msgs, mentions} = ChannelStore.getUnreadCounts()[chan.id] || {msgs: 0, mentions: 0};
|
||||||
|
TeamStore.subtractUnread(chan.team_id, msgs, mentions);
|
||||||
|
|
||||||
// Mark previous and next channel as read
|
// Mark previous and next channel as read
|
||||||
ChannelStore.resetCounts(oldChannelId);
|
ChannelStore.resetCounts(oldChannelId);
|
||||||
ChannelStore.resetCounts(chan.id);
|
ChannelStore.resetCounts(chan.id);
|
||||||
|
|||||||
@@ -321,6 +321,14 @@ 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
incrementMessages(id, channelId) {
|
incrementMessages(id, channelId) {
|
||||||
const channelMember = ChannelStore.getMyMember(channelId);
|
const channelMember = ChannelStore.getMyMember(channelId);
|
||||||
if (channelMember && channelMember.notify_props && channelMember.notify_props.mark_unread === NotificationPrefs.MENTION) {
|
if (channelMember && channelMember.notify_props && channelMember.notify_props.mark_unread === NotificationPrefs.MENTION) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user