summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webapp/components/needs_team.jsx4
-rw-r--r--webapp/components/post_view/post_view_cache.jsx5
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);
}