Unverified Commit c76cb3a0 authored by Martin Kraft's avatar Martin Kraft Committed by GitHub
Browse files

MM-10574: Fix for joining channel with 26 character name via switcher. (#1252)

parent bcc32d40
......@@ -30,7 +30,9 @@ function onChannelByIdentifierEnter({match, history}) {
if (identifier.length === LENGTH_OF_ID) {
// It's hard to tell an ID apart from a channel name of the same length, so check first if
// the identifier matches a channel that we have
if (ChannelStore.getByName(identifier)) {
const channelsByName = ChannelStore.getByName(identifier);
const moreChannelsByName = ChannelStore.getMoreChannelsList().find((chan) => chan.name === identifier);
if (channelsByName || moreChannelsByName) {
goToChannelByChannelName(match, history);
} else {
goToChannelByChannelId(match, history);
......
......@@ -23,6 +23,7 @@ import {
getUser,
searchProfiles,
} from 'mattermost-redux/selectors/entities/users';
import * as ChannelActions from 'mattermost-redux/actions/channels';
import GlobeIcon from 'components/svg/globe_icon';
import LockIcon from 'components/svg/lock_icon';
......@@ -226,13 +227,12 @@ export default class SwitchChannelProvider extends Provider {
usersAsync = Client4.autocompleteUsers(channelPrefix, '', '');
}
const channelsAsync = Client4.searchChannels(teamId, channelPrefix);
let usersFromServer = [];
let channelsFromServer = [];
try {
usersFromServer = await usersAsync;
channelsFromServer = await channelsAsync;
const {data} = await ChannelActions.searchChannels(teamId, channelPrefix)(store.dispatch, store.getState);
channelsFromServer = data;
} catch (err) {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_ERROR,
......
......@@ -7259,7 +7259,8 @@
"harmony-reflect": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/harmony-reflect/-/harmony-reflect-1.5.1.tgz",
"integrity": "sha1-tUymF7AMyK71Wbuxez2FQx3H4yk="
"integrity": "sha1-tUymF7AMyK71Wbuxez2FQx3H4yk=",
"dev": true
},
"has": {
"version": "1.0.1",
......@@ -10888,21 +10889,44 @@
"shallow-equals": "1.0.0"
},
"dependencies": {
"form-data": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz",
"integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "1.0.6",
"mime-types": "^2.1.12"
}
},
"harmony-reflect": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/harmony-reflect/-/harmony-reflect-1.6.0.tgz",
"integrity": "sha512-0kZ1XcoelFOLEjEtvWAZyq/1S55eDSieWEJwme311MNVNcRpvjlr2zA66kBV6WAB8C1XI1p1cXCnFPqd1BxlPg=="
},
"mime-db": {
"version": "1.33.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz",
"integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ=="
},
"redux": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz",
"integrity": "sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==",
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/redux/-/redux-4.0.0.tgz",
"integrity": "sha512-NnnHF0h0WVE/hXyrB6OlX67LYRuaf/rJcbWvnHHEPCF/Xa/AZpwhs/20WyqzQae5x4SD2F9nPObgBh2rxAgLiA==",
"requires": {
"lodash": "^4.2.1",
"lodash-es": "^4.2.1",
"loose-envify": "^1.1.0",
"symbol-observable": "^1.0.3"
"symbol-observable": "^1.2.0"
}
},
"redux-action-buffer": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/redux-action-buffer/-/redux-action-buffer-1.2.0.tgz",
"integrity": "sha1-LsCh2JnMn29EzN60Me5SrUHdl1U="
},
"redux-batched-actions": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/redux-batched-actions/-/redux-batched-actions-0.2.0.tgz",
"integrity": "sha1-2gAAyIKw5shhqW1YI702rfXZwN0="
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/redux-batched-actions/-/redux-batched-actions-0.3.0.tgz",
"integrity": "sha512-RsXFTY6F7jXYFXTVC/8/Zb+A4Im2uk4/9Dx/hO7B0hxLGdACmm2WC5vIYUXgP9B+ZLp7bwJTaF/iALfeJV+/zg=="
}
}
},
......@@ -11107,7 +11131,8 @@
"mime-db": {
"version": "1.30.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz",
"integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE="
"integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=",
"dev": true
},
"mime-types": {
"version": "2.1.18",
......@@ -14376,11 +14401,6 @@
"symbol-observable": "^1.2.0"
}
},
"redux-action-buffer": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/redux-action-buffer/-/redux-action-buffer-1.1.0.tgz",
"integrity": "sha1-nGkqtlMrBC0NQ6nwGkitoSD8lBo="
},
"redux-batched-actions": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/redux-batched-actions/-/redux-batched-actions-0.3.0.tgz",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment