Merge pull request #2115 from mattermost/plt-1506
PLT-1506 Fixing mentions for inactive browser tabs.
Этот коммит содержится в:
@@ -308,7 +308,7 @@ ChannelStore.dispatchToken = AppDispatcher.register((payload) => {
|
|||||||
ChannelStore.storeChannels(action.channels);
|
ChannelStore.storeChannels(action.channels);
|
||||||
ChannelStore.storeChannelMembers(action.members);
|
ChannelStore.storeChannelMembers(action.members);
|
||||||
currentId = ChannelStore.getCurrentId();
|
currentId = ChannelStore.getCurrentId();
|
||||||
if (currentId) {
|
if (currentId && !document.hidden) {
|
||||||
ChannelStore.resetCounts(currentId);
|
ChannelStore.resetCounts(currentId);
|
||||||
}
|
}
|
||||||
ChannelStore.setUnreadCounts();
|
ChannelStore.setUnreadCounts();
|
||||||
@@ -321,7 +321,7 @@ ChannelStore.dispatchToken = AppDispatcher.register((payload) => {
|
|||||||
ChannelStore.pStoreChannelMember(action.member);
|
ChannelStore.pStoreChannelMember(action.member);
|
||||||
}
|
}
|
||||||
currentId = ChannelStore.getCurrentId();
|
currentId = ChannelStore.getCurrentId();
|
||||||
if (currentId) {
|
if (currentId && !document.hidden) {
|
||||||
ChannelStore.resetCounts(currentId);
|
ChannelStore.resetCounts(currentId);
|
||||||
}
|
}
|
||||||
ChannelStore.setUnreadCount(action.channel.id);
|
ChannelStore.setUnreadCount(action.channel.id);
|
||||||
|
|||||||
@@ -188,7 +188,9 @@ function handleNewPostEvent(msg, translations) {
|
|||||||
|
|
||||||
// Update channel state
|
// Update channel state
|
||||||
if (ChannelStore.getCurrentId() === msg.channel_id) {
|
if (ChannelStore.getCurrentId() === msg.channel_id) {
|
||||||
if (window.isActive) {
|
if (document.hidden) {
|
||||||
|
AsyncClient.getChannel(msg.channel_id);
|
||||||
|
} else {
|
||||||
AsyncClient.updateLastViewedAt();
|
AsyncClient.updateLastViewedAt();
|
||||||
}
|
}
|
||||||
} else if (UserStore.getCurrentId() !== msg.user_id || post.type !== Constants.POST_TYPE_JOIN_LEAVE) {
|
} else if (UserStore.getCurrentId() !== msg.user_id || post.type !== Constants.POST_TYPE_JOIN_LEAVE) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user