summaryrefslogtreecommitdiffstats
path: root/web/react/stores/socket_store.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-02-13 11:03:10 -0500
committerChristopher Speller <crspeller@gmail.com>2016-02-13 11:03:10 -0500
commit958b588448a0bc405068345f267aa623c5014d67 (patch)
tree3f871a2c7654b739e9d8e9d020946d6ceee67b6a /web/react/stores/socket_store.jsx
parent45dfd516aab37c1c336ac3410ee8db0d7c56d65a (diff)
parentc71c5cef632c7dc68072167c6fe091a60835fa02 (diff)
downloadchat-958b588448a0bc405068345f267aa623c5014d67.tar.gz
chat-958b588448a0bc405068345f267aa623c5014d67.tar.bz2
chat-958b588448a0bc405068345f267aa623c5014d67.zip
Merge branch 'release-2.0'
Diffstat (limited to 'web/react/stores/socket_store.jsx')
-rw-r--r--web/react/stores/socket_store.jsx6
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);