diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-02-09 11:09:29 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-02-09 11:18:50 -0500 |
commit | 0d50cdd390198d18c3298be5cafc39dfd4d67bbd (patch) | |
tree | 6d281c7f72fddf67c9fa987781ec91ca6395140f /web/react/stores/socket_store.jsx | |
parent | ffcca796c3b7f14eac52d4d1542105ef03b047a5 (diff) | |
download | chat-0d50cdd390198d18c3298be5cafc39dfd4d67bbd.tar.gz chat-0d50cdd390198d18c3298be5cafc39dfd4d67bbd.tar.bz2 chat-0d50cdd390198d18c3298be5cafc39dfd4d67bbd.zip |
Changing meation behaviour to show meantion when viewing channel but tab is not focused
Diffstat (limited to 'web/react/stores/socket_store.jsx')
-rw-r--r-- | web/react/stores/socket_store.jsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx index bc2bdbe64..e1b65fe14 100644 --- a/web/react/stores/socket_store.jsx +++ b/web/react/stores/socket_store.jsx @@ -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) { |