mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Changing meation behaviour to show meantion when viewing channel but tab is not focused
This commit is contained in:
@@ -308,7 +308,7 @@ ChannelStore.dispatchToken = AppDispatcher.register((payload) => {
|
||||
ChannelStore.storeChannels(action.channels);
|
||||
ChannelStore.storeChannelMembers(action.members);
|
||||
currentId = ChannelStore.getCurrentId();
|
||||
if (currentId) {
|
||||
if (currentId && !document.hidden) {
|
||||
ChannelStore.resetCounts(currentId);
|
||||
}
|
||||
ChannelStore.setUnreadCounts();
|
||||
@@ -321,7 +321,7 @@ ChannelStore.dispatchToken = AppDispatcher.register((payload) => {
|
||||
ChannelStore.pStoreChannelMember(action.member);
|
||||
}
|
||||
currentId = ChannelStore.getCurrentId();
|
||||
if (currentId) {
|
||||
if (currentId && !document.hidden) {
|
||||
ChannelStore.resetCounts(currentId);
|
||||
}
|
||||
ChannelStore.setUnreadCount(action.channel.id);
|
||||
|
||||
@@ -188,7 +188,9 @@ function handleNewPostEvent(msg, translations) {
|
||||
|
||||
// Update channel state
|
||||
if (ChannelStore.getCurrentId() === msg.channel_id) {
|
||||
if (window.isActive) {
|
||||
if (document.hidden) {
|
||||
AsyncClient.getChannel(msg.channel_id);
|
||||
} else {
|
||||
AsyncClient.updateLastViewedAt();
|
||||
}
|
||||
} else if (UserStore.getCurrentId() !== msg.user_id || post.type !== Constants.POST_TYPE_JOIN_LEAVE) {
|
||||
|
||||
Reference in New Issue
Block a user