diff options
author | JoramWilander <jwawilander@gmail.com> | 2016-02-12 14:23:12 -0500 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2016-02-12 14:23:12 -0500 |
commit | c861a24d48d2cb5417f704eca7d28db7637275f6 (patch) | |
tree | f958ccda0970acd32b569c7734452b369dfee8d9 /web/react/stores/socket_store.jsx | |
parent | 6cb4f82ee5a17cd1d32ae19c266b78c2cfd604e6 (diff) | |
download | chat-c861a24d48d2cb5417f704eca7d28db7637275f6.tar.gz chat-c861a24d48d2cb5417f704eca7d28db7637275f6.tar.bz2 chat-c861a24d48d2cb5417f704eca7d28db7637275f6.zip |
Fix badge and tab */(1) not disappearing until switching away from channel
Diffstat (limited to 'web/react/stores/socket_store.jsx')
-rw-r--r-- | web/react/stores/socket_store.jsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx index 424c7fe57..efb57e226 100644 --- a/web/react/stores/socket_store.jsx +++ b/web/react/stores/socket_store.jsx @@ -202,10 +202,10 @@ function handleNewPostEvent(msg, translations) { // Update channel state if (ChannelStore.getCurrentId() === msg.channel_id) { - if (document.hidden) { - AsyncClient.getChannel(msg.channel_id); - } else { + if (window.isActive) { AsyncClient.updateLastViewedAt(); + } else { + AsyncClient.getChannel(msg.channel_id); } } else if (UserStore.getCurrentId() !== msg.user_id || post.type !== Constants.POST_TYPE_JOIN_LEAVE) { AsyncClient.getChannel(msg.channel_id); |