MM-14055: Load the channel even if not joining. (#2567)

This commit is contained in:
Martin Kraft 2019-02-13 05:35:43 -05:00
parent 4f3679e09d
commit 87af5404ae

View file

@ -311,9 +311,9 @@ export default class Permalink extends PureComponent {
if (!channelId) {
const focusedPost = post.data && post.data.posts ? post.data.posts[focusedPostId] : null;
focusChannelId = focusedPost ? focusedPost.channel_id : '';
if (focusChannelId && !this.props.myMembers[focusChannelId]) {
if (focusChannelId) {
const {data: channel} = await actions.getChannel(focusChannelId);
if (channel && channel.type === General.OPEN_CHANNEL) {
if (!this.props.myMembers[focusChannelId] && channel && channel.type === General.OPEN_CHANNEL) {
await actions.joinChannel(currentUserId, channel.team_id, channel.id);
}
}