diff --git a/app/components/channel_drawer/teams_list/index.js b/app/components/channel_drawer/teams_list/index.js index d6582e635..c64aaf076 100644 --- a/app/components/channel_drawer/teams_list/index.js +++ b/app/components/channel_drawer/teams_list/index.js @@ -5,7 +5,7 @@ import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; import {getCurrentUrl} from 'mattermost-redux/selectors/entities/general'; -import {getCurrentTeamId, getJoinableTeamIds, getMySortedTeamIds} from 'mattermost-redux/selectors/entities/teams'; +import {getCurrentTeamId, getMySortedTeamIds} from 'mattermost-redux/selectors/entities/teams'; import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {handleTeamChange} from 'app/actions/views/select_team'; @@ -18,7 +18,6 @@ function mapStateToProps(state) { const locale = getCurrentLocale(state); return { - canJoinOtherTeams: getJoinableTeamIds(state).length > 0, currentTeamId: getCurrentTeamId(state), currentUrl: removeProtocol(getCurrentUrl(state)), teamIds: getMySortedTeamIds(state, locale), diff --git a/app/components/channel_drawer/teams_list/teams_list.js b/app/components/channel_drawer/teams_list/teams_list.js index 8b8b8d715..7a91e099a 100644 --- a/app/components/channel_drawer/teams_list/teams_list.js +++ b/app/components/channel_drawer/teams_list/teams_list.js @@ -33,7 +33,6 @@ class TeamsList extends PureComponent { actions: PropTypes.shape({ handleTeamChange: PropTypes.func.isRequired, }).isRequired, - canJoinOtherTeams: PropTypes.bool.isRequired, closeChannelDrawer: PropTypes.func.isRequired, currentTeamId: PropTypes.string.isRequired, currentUrl: PropTypes.string.isRequired, @@ -106,25 +105,22 @@ class TeamsList extends PureComponent { }; render() { - const {canJoinOtherTeams, teamIds, theme} = this.props; + const {teamIds, theme} = this.props; const styles = getStyleSheet(theme); - let moreAction; - if (canJoinOtherTeams) { - moreAction = ( - + - - {'+'} - - - ); - } + {'+'} + + + ); return ( diff --git a/app/screens/select_team/index.js b/app/screens/select_team/index.js index 1f93da429..c1045bb49 100644 --- a/app/screens/select_team/index.js +++ b/app/screens/select_team/index.js @@ -7,7 +7,7 @@ import {connect} from 'react-redux'; import {handleTeamChange} from 'app/actions/views/select_team'; import {markChannelAsRead} from 'mattermost-redux/actions/channels'; -import {joinTeam} from 'mattermost-redux/actions/teams'; +import {getTeams, joinTeam} from 'mattermost-redux/actions/teams'; import {logout} from 'mattermost-redux/actions/users'; import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels'; import {getJoinableTeams} from 'mattermost-redux/selectors/entities/teams'; @@ -34,6 +34,7 @@ function mapStateToProps(state) { function mapDispatchToProps(dispatch) { return { actions: bindActionCreators({ + getTeams, handleTeamChange, joinTeam, logout, diff --git a/app/screens/select_team/select_team.js b/app/screens/select_team/select_team.js index 59e7de1cb..eeeeeaf14 100644 --- a/app/screens/select_team/select_team.js +++ b/app/screens/select_team/select_team.js @@ -28,6 +28,7 @@ const VIEWABILITY_CONFIG = ListTypes.VISIBILITY_CONFIG_DEFAULTS; export default class SelectTeam extends PureComponent { static propTypes = { actions: PropTypes.shape({ + getTeams: PropTypes.func.isRequired, handleTeamChange: PropTypes.func.isRequired, joinTeam: PropTypes.func.isRequired, logout: PropTypes.func.isRequired, @@ -53,7 +54,9 @@ export default class SelectTeam extends PureComponent { } componentDidMount() { - this.buildData(this.props); + this.props.actions.getTeams().then(() => { + this.buildData(this.props); + }); } componentWillReceiveProps(nextProps) {