Skip to content

Commit

Permalink
Add check for isCloud to main_menu for displaying user_limit_modal (m…
Browse files Browse the repository at this point in the history
…attermost#6792)

Co-authored-by: Mattermod <[email protected]>
  • Loading branch information
nickmisasi and mattermod committed Oct 19, 2020
1 parent 3505e74 commit 65b0319
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion components/main_menu/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';

import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {
getConfig,
getLicense,
} from 'mattermost-redux/selectors/entities/general';
import {
getMyTeams,
getJoinableTeamIds,
Expand Down Expand Up @@ -105,6 +108,7 @@ function mapStateToProps(state) {
showNextStepsTips: showNextStepsTips(state),
showNextSteps: showNextSteps(state),
subscription: state.entities.cloud.subscription,
isCloud: getLicense(state).Cloud === 'true',
};
}

Expand Down
3 changes: 2 additions & 1 deletion components/main_menu/main_menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class MainMenu extends React.PureComponent {
intl: intlShape.isRequired,
showNextStepsTips: PropTypes.bool,
subscription: PropTypes.object,
isCloud: PropTypes.bool,
actions: PropTypes.shape({
openModal: PropTypes.func.isRequred,
showMentions: PropTypes.func,
Expand Down Expand Up @@ -134,7 +135,7 @@ class MainMenu extends React.PureComponent {
return false;
}

return (this.props.currentUsers >= this.props.userLimit) && (this.props.userLimit !== '0') && this.props.userIsAdmin;
return this.props.isCloud && (this.props.currentUsers >= this.props.userLimit) && (this.props.userLimit !== '0') && this.props.userIsAdmin;
}

render() {
Expand Down

0 comments on commit 65b0319

Please sign in to comment.