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 committed by GitHub
parent 5eac23ea8c
commit 70907d061c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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);
}
}