Fix badge and tab */(1) not disappearing until switching away from channel
Этот коммит содержится в:
@@ -95,6 +95,8 @@ class ChannelLoader extends React.Component {
|
|||||||
|
|
||||||
$(window).on('focus', function windowFocus() {
|
$(window).on('focus', function windowFocus() {
|
||||||
AsyncClient.updateLastViewedAt();
|
AsyncClient.updateLastViewedAt();
|
||||||
|
ChannelStore.resetCounts(ChannelStore.getCurrentId());
|
||||||
|
ChannelStore.emitChange();
|
||||||
window.isActive = true;
|
window.isActive = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -185,4 +187,4 @@ ChannelLoader.propTypes = {
|
|||||||
intl: intlShape.isRequired
|
intl: intlShape.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
export default injectIntl(ChannelLoader);
|
export default injectIntl(ChannelLoader);
|
||||||
|
|||||||
@@ -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 && !document.hidden) {
|
if (currentId && window.isActive) {
|
||||||
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 && !document.hidden) {
|
if (currentId && window.isActive) {
|
||||||
ChannelStore.resetCounts(currentId);
|
ChannelStore.resetCounts(currentId);
|
||||||
}
|
}
|
||||||
ChannelStore.setUnreadCount(action.channel.id);
|
ChannelStore.setUnreadCount(action.channel.id);
|
||||||
|
|||||||
@@ -202,10 +202,10 @@ function handleNewPostEvent(msg, translations) {
|
|||||||
|
|
||||||
// Update channel state
|
// Update channel state
|
||||||
if (ChannelStore.getCurrentId() === msg.channel_id) {
|
if (ChannelStore.getCurrentId() === msg.channel_id) {
|
||||||
if (document.hidden) {
|
if (window.isActive) {
|
||||||
AsyncClient.getChannel(msg.channel_id);
|
|
||||||
} else {
|
|
||||||
AsyncClient.updateLastViewedAt();
|
AsyncClient.updateLastViewedAt();
|
||||||
|
} else {
|
||||||
|
AsyncClient.getChannel(msg.channel_id);
|
||||||
}
|
}
|
||||||
} 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) {
|
||||||
AsyncClient.getChannel(msg.channel_id);
|
AsyncClient.getChannel(msg.channel_id);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user