that was a bad idea

This commit is contained in:
Cade Scroggins 2018-06-30 21:42:59 -07:00
parent 332303203d
commit 50d271d691

View file

@ -666,20 +666,16 @@
suggest(input) {
input = input.trim();
if (input === '') this._clearSuggestions();
let suggestions = [];
for (const influencer of this._getInfluencerPromises(input)) {
influencer.then(res => {
suggestions = this._flattenAndUnique([...suggestions, ...res]);
this._clearSuggestions();
if (suggestions.length) {
this._appendSuggestions(suggestions, input);
this._registerSuggestionEvents();
$.bodyClassAdd('suggestions');
}
});
}
Promise.all(this._getInfluencerPromises(input)).then(res => {
const suggestions = this._flattenAndUnique(res);
this._clearSuggestions();
if (suggestions.length) {
this._appendSuggestions(suggestions, input);
this._registerSuggestionEvents();
$.bodyClassAdd('suggestions');
}
});
}
_appendSuggestions(suggestions, input) {