PLT-5629 don't mark channels as unread with system messages (#291)
This commit is contained in:
parent
06cf8b7851
commit
59ca3695b5
1 changed files with 3 additions and 2 deletions
|
|
@ -31,6 +31,7 @@ import {
|
|||
} from 'service/constants';
|
||||
import {getCurrentChannelStats} from 'service/selectors/entities/channels';
|
||||
import {getUserIdFromChannelName} from 'service/utils/channel_utils';
|
||||
import {isSystemMessage} from 'service/utils/post_utils';
|
||||
import EventEmitter from 'service/utils/event_emitter';
|
||||
|
||||
export function init(siteUrl, token, optionalWebSocket) {
|
||||
|
|
@ -217,8 +218,8 @@ async function handleNewPostEvent(msg, dispatch, getState) {
|
|||
}
|
||||
]), getState);
|
||||
|
||||
if (userId === users.currentId || post.channel_id === currentChannelId) {
|
||||
markChannelAsRead(post.channel_id);
|
||||
if (userId === users.currentId || post.channel_id === currentChannelId || isSystemMessage(post)) {
|
||||
markChannelAsRead(post.channel_id)(dispatch, getState);
|
||||
} else {
|
||||
markChannelAsUnread(post.channel_id, msg.data.mentions)(dispatch, getState);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue