mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 06:39:40 +08:00
No need to query the API about nothing
This commit is contained in:
parent
6455d03eb6
commit
80474ec544
@ -152,15 +152,17 @@ export default function() {
|
||||
dropdown.active(true);
|
||||
|
||||
clearTimeout(searchTimeout);
|
||||
searchTimeout = setTimeout(function() {
|
||||
var typedLower = typed.toLowerCase();
|
||||
if (searched.indexOf(typedLower) === -1) {
|
||||
app.store.find('users', {q: typed, page: {limit: 5}}).then(users => {
|
||||
if (dropdown.active()) buildSuggestions();
|
||||
});
|
||||
searched.push(typedLower);
|
||||
}
|
||||
}, 250);
|
||||
if (typed) {
|
||||
searchTimeout = setTimeout(function() {
|
||||
var typedLower = typed.toLowerCase();
|
||||
if (searched.indexOf(typedLower) === -1) {
|
||||
app.store.find('users', {q: typed, page: {limit: 5}}).then(users => {
|
||||
if (dropdown.active()) buildSuggestions();
|
||||
});
|
||||
searched.push(typedLower);
|
||||
}
|
||||
}, 250);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user