FIX: on enter we would double search on full page search
This commit is contained in:
parent
5eb1fb3bfd
commit
5ed7663a63
|
@ -64,6 +64,11 @@ export default Ember.Controller.extend({
|
||||||
canBulkSelect: Em.computed.alias('currentUser.staff'),
|
canBulkSelect: Em.computed.alias('currentUser.staff'),
|
||||||
|
|
||||||
search(){
|
search(){
|
||||||
|
if (this._searching) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this._searching = true;
|
||||||
|
|
||||||
const router = Discourse.__container__.lookup('router:main');
|
const router = Discourse.__container__.lookup('router:main');
|
||||||
|
|
||||||
this.set("q", this.get("searchTerm"));
|
this.set("q", this.get("searchTerm"));
|
||||||
|
@ -85,7 +90,7 @@ export default Ember.Controller.extend({
|
||||||
const model = translateResults(results) || {};
|
const model = translateResults(results) || {};
|
||||||
router.transientCache('lastSearch', { searchKey, model }, 5);
|
router.transientCache('lastSearch', { searchKey, model }, 5);
|
||||||
this.set("model", model);
|
this.set("model", model);
|
||||||
});
|
}).finally(() => {this._searching = false});
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
Loading…
Reference in New Issue