diff options
Diffstat (limited to 'webapp/components/quick_switch_modal')
-rw-r--r-- | webapp/components/quick_switch_modal/index.js | 3 | ||||
-rw-r--r-- | webapp/components/quick_switch_modal/quick_switch_modal.jsx | 33 |
2 files changed, 16 insertions, 20 deletions
diff --git a/webapp/components/quick_switch_modal/index.js b/webapp/components/quick_switch_modal/index.js index 7826fd8f5..ad5d1dd7c 100644 --- a/webapp/components/quick_switch_modal/index.js +++ b/webapp/components/quick_switch_modal/index.js @@ -2,14 +2,13 @@ // See License.txt for license information. import {connect} from 'react-redux'; -import {getMyTeams} from 'mattermost-redux/selectors/entities/teams'; import QuickSwitchModal from './quick_switch_modal.jsx'; function mapStateToProps(state, ownProps) { return { ...ownProps, - showTeamSwitcher: getMyTeams(state).length > 1 + showTeamSwitcher: false }; } diff --git a/webapp/components/quick_switch_modal/quick_switch_modal.jsx b/webapp/components/quick_switch_modal/quick_switch_modal.jsx index 24eb8fcba..aed274510 100644 --- a/webapp/components/quick_switch_modal/quick_switch_modal.jsx +++ b/webapp/components/quick_switch_modal/quick_switch_modal.jsx @@ -22,7 +22,6 @@ import store from 'stores/redux_store.jsx'; const getState = store.getState; import {getChannel} from 'mattermost-redux/selectors/entities/channels'; -import {getUserByUsername} from 'mattermost-redux/selectors/entities/users'; const CHANNEL_MODE = 'channel'; const TEAM_MODE = 'team'; @@ -141,24 +140,22 @@ export default class QuickSwitchModal extends React.PureComponent { if (this.state.mode === CHANNEL_MODE) { const selectedChannel = selected.channel; if (selectedChannel.type === Constants.DM_CHANNEL) { - const user = getUserByUsername(getState(), selectedChannel.name); - - if (user) { - openDirectChannelToUser( - user.id, - (ch) => { - channel = ch; - this.switchToChannel(channel); - }, - () => { - channel = null; - this.switchToChannel(channel); - } - ); - } - } else { + openDirectChannelToUser( + selectedChannel.id, + (ch) => { + channel = ch; + this.switchToChannel(channel); + }, + () => { + channel = null; + this.switchToChannel(channel); + } + ); + } else if (selectedChannel.type === Constants.GM_CHANNEL) { channel = getChannel(getState(), selectedChannel.id); this.switchToChannel(channel); + } else { + this.switchToChannel(selectedChannel); } } else { browserHistory.push('/' + selected.name); @@ -287,7 +284,7 @@ export default class QuickSwitchModal extends React.PureComponent { help = ( <FormattedMessage id='quick_switch_modal.help_no_team' - defaultMessage='Start typing then use ↑↓ to browse, ↵ to select, and ESC to dismiss.' + defaultMessage='Type to find a channel. Use ↑↓ to browse, ↵ to select, ESC to dismiss.' /> ); } |