summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/post_view')
-rw-r--r--webapp/components/post_view/post_view_cache.jsx5
1 files changed, 4 insertions, 1 deletions
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);
}