summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-09-28 08:43:22 -0400
committerChristopher Speller <crspeller@gmail.com>2016-09-28 08:43:22 -0400
commitb640114edd1abb7e9938e0583b8a5a9e0c6c2383 (patch)
treeed4d019e7071490bd7a4643056c74e8458c1c5ac /webapp/components/post_view
parent60347559c7fb857bd5afcd93e65b6e220625da79 (diff)
downloadchat-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/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);
}