summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-11-21 13:03:54 -0500
committerGitHub <noreply@github.com>2016-11-21 13:03:54 -0500
commit43c703e216c4145f5c61ed3b7453d72bd20306d0 (patch)
tree6186a6e1488f28f2f9311fe8b05579d490ac49d8 /webapp/components/post_view
parent0ef77dff13bc74a396a412d7d416c7a7a3a9f447 (diff)
downloadchat-43c703e216c4145f5c61ed3b7453d72bd20306d0.tar.gz
chat-43c703e216c4145f5c61ed3b7453d72bd20306d0.tar.bz2
chat-43c703e216c4145f5c61ed3b7453d72bd20306d0.zip
PLT-4787 Fixed not being able to join a channel through a link after opening the More Channels modal (#4616)
Diffstat (limited to 'webapp/components/post_view')
-rw-r--r--webapp/components/post_view/post_view_cache.jsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/webapp/components/post_view/post_view_cache.jsx b/webapp/components/post_view/post_view_cache.jsx
index c1b278c35..3b6123b09 100644
--- a/webapp/components/post_view/post_view_cache.jsx
+++ b/webapp/components/post_view/post_view_cache.jsx
@@ -17,11 +17,12 @@ export default class PostViewCache extends React.Component {
this.onChannelChange = this.onChannelChange.bind(this);
+ const currentChannelId = ChannelStore.getCurrentId();
const channel = ChannelStore.getCurrent();
this.state = {
- currentChannelId: channel.id,
- channels: [channel]
+ currentChannelId,
+ channels: channel ? [channel] : []
};
}
@@ -40,7 +41,7 @@ export default class PostViewCache extends React.Component {
const channels = Object.assign([], this.state.channels);
const currentChannel = ChannelStore.getCurrent();
- if (currentChannel == null) {
+ if (!currentChannel) {
return;
}