From 0d50cdd390198d18c3298be5cafc39dfd4d67bbd Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 9 Feb 2016 11:09:29 -0500 Subject: Changing meation behaviour to show meantion when viewing channel but tab is not focused --- web/react/stores/socket_store.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'web/react/stores/socket_store.jsx') 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) { -- cgit v1.2.3-1-g7c22