diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-09-28 08:43:22 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-09-28 08:43:22 -0400 |
commit | b640114edd1abb7e9938e0583b8a5a9e0c6c2383 (patch) | |
tree | ed4d019e7071490bd7a4643056c74e8458c1c5ac /webapp/components | |
parent | 60347559c7fb857bd5afcd93e65b6e220625da79 (diff) | |
download | chat-b640114edd1abb7e9938e0583b8a5a9e0c6c2383.tar.gz chat-b640114edd1abb7e9938e0583b8a5a9e0c6c2383.tar.bz2 chat-b640114edd1abb7e9938e0583b8a5a9e0c6c2383.zip |
Check if user logged in before making setActiveChannel request (#4097)
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/needs_team.jsx | 4 | ||||
-rw-r--r-- | webapp/components/post_view/post_view_cache.jsx | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/webapp/components/needs_team.jsx b/webapp/components/needs_team.jsx index c5408b18b..1c7bc307d 100644 --- a/webapp/components/needs_team.jsx +++ b/webapp/components/needs_team.jsx @@ -97,7 +97,9 @@ export default class NeedsTeam extends React.Component { $(window).on('blur', () => { window.isActive = false; - AsyncClient.setActiveChannel(''); + if (UserStore.getCurrentUser()) { + 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 8ed225e4b..c1b278c35 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 UserStore from 'stores/user_store.jsx'; import * as AsyncClient from 'utils/async_client.jsx'; import React from 'react'; @@ -29,7 +30,9 @@ export default class PostViewCache extends React.Component { } componentWillUnmount() { - AsyncClient.setActiveChannel(''); + if (UserStore.getCurrentUser()) { + AsyncClient.setActiveChannel(''); + } ChannelStore.removeChangeListener(this.onChannelChange); } |