mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 22:06:20 +08:00
FIX: Error with debouncing mentions
This commit is contained in:
parent
2ec1aec2be
commit
4eef41ea1b
|
@ -23,6 +23,9 @@ function performSearch(
|
||||||
resultsFn(cached);
|
resultsFn(cached);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (term === "") {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
// need to be able to cancel this
|
// need to be able to cancel this
|
||||||
oldSearch = $.ajax(userPath("search/users"), {
|
oldSearch = $.ajax(userPath("search/users"), {
|
||||||
|
@ -122,10 +125,6 @@ export default function userSearch(options) {
|
||||||
currentTerm = term;
|
currentTerm = term;
|
||||||
|
|
||||||
return new Ember.RSVP.Promise(function(resolve) {
|
return new Ember.RSVP.Promise(function(resolve) {
|
||||||
if (term.length === 0) {
|
|
||||||
resolve([]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (new Date() - cacheTime > 30000 || cacheTopicId !== topicId) {
|
if (new Date() - cacheTime > 30000 || cacheTopicId !== topicId) {
|
||||||
cache = {};
|
cache = {};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user