diff --git a/app/screens/more_channels/index.js b/app/screens/more_channels/index.js index 8cd58fb7d..74bfc07f7 100644 --- a/app/screens/more_channels/index.js +++ b/app/screens/more_channels/index.js @@ -29,7 +29,7 @@ function mapStateToProps(state, ownProps) { return { ...ownProps, - canCreateChannels: showCreateOption(config, license, General.PRIVATE_CHANNEL, isAdmin(roles), isSystemAdmin(roles)), + canCreateChannels: showCreateOption(config, license, General.OPEN_CHANNEL, isAdmin(roles), isSystemAdmin(roles)), currentUserId, currentTeamId, channels, diff --git a/app/screens/more_channels/more_channels.js b/app/screens/more_channels/more_channels.js index 64f38c0a6..a504bbe8b 100644 --- a/app/screens/more_channels/more_channels.js +++ b/app/screens/more_channels/more_channels.js @@ -100,6 +100,8 @@ class MoreChannels extends PureComponent { const channels = nextProps.channels.splice(0, (page + 1) * General.CHANNELS_CHUNK_SIZE); this.setState({channels, showNoResults: true}); } + + this.headerButtons(nextProps.canCreateChannels, true); } close = () => { @@ -107,11 +109,15 @@ class MoreChannels extends PureComponent { }; emitCanCreateChannel = (enabled) => { + this.headerButtons(this.props.canCreateChannels, enabled); + }; + + headerButtons = (canCreateChannels, enabled) => { const buttons = { leftButtons: [this.leftButton] }; - if (this.props.canCreateChannels) { + if (canCreateChannels) { buttons.rightButtons = [{...this.rightButton, disabled: !enabled}]; }