summaryrefslogtreecommitdiffstats
path: root/webapp/components
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-09-02 12:50:15 -0400
committerGitHub <noreply@github.com>2016-09-02 12:50:15 -0400
commitf32eb525f3fa0828a23f589d765c267e3b2aea86 (patch)
treed4b76aecf89143029af080b3e1b4d87398e0adc5 /webapp/components
parenteb0111f6bbe2b0bf160a674dfe1b4d089f905cb9 (diff)
downloadchat-f32eb525f3fa0828a23f589d765c267e3b2aea86.tar.gz
chat-f32eb525f3fa0828a23f589d765c267e3b2aea86.tar.bz2
chat-f32eb525f3fa0828a23f589d765c267e3b2aea86.zip
Do not send push notifications for channels being actively viewed (#3931)
Diffstat (limited to 'webapp/components')
-rw-r--r--webapp/components/needs_team.jsx1
-rw-r--r--webapp/components/post_view/post_view_cache.jsx2
2 files changed, 3 insertions, 0 deletions
diff --git a/webapp/components/needs_team.jsx b/webapp/components/needs_team.jsx
index 6c023d497..cd80f0fc7 100644
--- a/webapp/components/needs_team.jsx
+++ b/webapp/components/needs_team.jsx
@@ -94,6 +94,7 @@ export default class NeedsTeam extends React.Component {
$(window).on('blur', () => {
window.isActive = false;
+ AsyncClient.setActiveChannel('');
});
Utils.applyTheme(this.state.theme);
diff --git a/webapp/components/post_view/post_view_cache.jsx b/webapp/components/post_view/post_view_cache.jsx
index 8876ae461..13ce79d7f 100644
--- a/webapp/components/post_view/post_view_cache.jsx
+++ b/webapp/components/post_view/post_view_cache.jsx
@@ -4,6 +4,7 @@
import PostViewController from './post_view_controller.jsx';
import ChannelStore from 'stores/channel_store.jsx';
+import * as AsyncClient from 'utils/async_client.jsx';
import React from 'react';
@@ -28,6 +29,7 @@ export default class PostViewCache extends React.Component {
}
componentWillUnmount() {
+ AsyncClient.setActiveChannel('');
ChannelStore.removeChangeListener(this.onChannelChange);
}