PLT-6431 Prevented autocompleting while suggestions are being received (#6328)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
72351c8ef8
Коммит
44a8f76d99
@@ -113,7 +113,7 @@ export default class AtMentionProvider extends Provider {
|
||||
|
||||
const prefix = captured[1];
|
||||
|
||||
this.startNewRequest(prefix);
|
||||
this.startNewRequest(suggestionId, prefix);
|
||||
|
||||
autocompleteUsersInChannel(
|
||||
prefix,
|
||||
|
||||
@@ -75,7 +75,7 @@ export default class ChannelMentionProvider extends Provider {
|
||||
|
||||
const prefix = captured[3];
|
||||
|
||||
this.startNewRequest(prefix);
|
||||
this.startNewRequest(suggestionId, prefix);
|
||||
|
||||
autocompleteChannels(
|
||||
prefix,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
import SuggestionStore from 'stores/suggestion_store.jsx';
|
||||
|
||||
export default class Provider {
|
||||
constructor() {
|
||||
this.latestPrefix = '';
|
||||
@@ -11,9 +13,12 @@ export default class Provider {
|
||||
// NO-OP for inherited classes to override
|
||||
}
|
||||
|
||||
startNewRequest(prefix) {
|
||||
startNewRequest(suggestionId, prefix) {
|
||||
this.latestPrefix = prefix;
|
||||
this.latestComplete = false;
|
||||
|
||||
// Don't use the dispatcher here since this is only called while handling an event
|
||||
SuggestionStore.setSuggestionsPending(suggestionId, true);
|
||||
}
|
||||
|
||||
shouldCancelDispatch(prefix) {
|
||||
|
||||
@@ -40,7 +40,7 @@ export default class SearchChannelProvider extends Provider {
|
||||
if (captured) {
|
||||
const channelPrefix = captured[1];
|
||||
|
||||
this.startNewRequest(channelPrefix);
|
||||
this.startNewRequest(suggestionId, channelPrefix);
|
||||
|
||||
autocompleteChannels(
|
||||
channelPrefix,
|
||||
|
||||
@@ -63,7 +63,7 @@ export default class SearchUserProvider extends Provider {
|
||||
if (captured) {
|
||||
const usernamePrefix = captured[1];
|
||||
|
||||
this.startNewRequest(usernamePrefix);
|
||||
this.startNewRequest(suggestionId, usernamePrefix);
|
||||
|
||||
autocompleteUsersInTeam(
|
||||
usernamePrefix,
|
||||
|
||||
@@ -60,7 +60,7 @@ class SwitchChannelSuggestion extends Suggestion {
|
||||
export default class SwitchChannelProvider extends Provider {
|
||||
handlePretextChanged(suggestionId, channelPrefix) {
|
||||
if (channelPrefix) {
|
||||
this.startNewRequest(channelPrefix);
|
||||
this.startNewRequest(suggestionId, channelPrefix);
|
||||
|
||||
const allChannels = ChannelStore.getAll();
|
||||
const channels = [];
|
||||
|
||||
Ссылка в новой задаче
Block a user