summaryrefslogtreecommitdiffstats
path: root/webapp/components/suggestion/search_channel_provider.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/suggestion/search_channel_provider.jsx')
-rw-r--r--webapp/components/suggestion/search_channel_provider.jsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/webapp/components/suggestion/search_channel_provider.jsx b/webapp/components/suggestion/search_channel_provider.jsx
index 283113fb9..8965e7a76 100644
--- a/webapp/components/suggestion/search_channel_provider.jsx
+++ b/webapp/components/suggestion/search_channel_provider.jsx
@@ -2,6 +2,7 @@
// See License.txt for license information.
import Suggestion from './suggestion.jsx';
+import Provider from './provider.jsx';
import {autocompleteChannels} from 'actions/channel_actions.jsx';
@@ -32,15 +33,21 @@ class SearchChannelSuggestion extends Suggestion {
}
}
-export default class SearchChannelProvider {
+export default class SearchChannelProvider extends Provider {
handlePretextChanged(suggestionId, pretext) {
const captured = (/\b(?:in|channel):\s*(\S*)$/i).exec(pretext.toLowerCase());
if (captured) {
const channelPrefix = captured[1];
+ this.startNewRequest(channelPrefix);
+
autocompleteChannels(
channelPrefix,
(data) => {
+ if (this.shouldCancelDispatch(channelPrefix)) {
+ return;
+ }
+
const publicChannels = data;
const localChannels = ChannelStore.getAll();