From 5ed7663a635481504e830641228733ba31a64400 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 9 Sep 2015 12:00:31 +1000 Subject: [PATCH] FIX: on enter we would double search on full page search --- .../discourse/controllers/full-page-search.js.es6 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/full-page-search.js.es6 b/app/assets/javascripts/discourse/controllers/full-page-search.js.es6 index 564ae96ea17..fce0fecd836 100644 --- a/app/assets/javascripts/discourse/controllers/full-page-search.js.es6 +++ b/app/assets/javascripts/discourse/controllers/full-page-search.js.es6 @@ -64,6 +64,11 @@ export default Ember.Controller.extend({ canBulkSelect: Em.computed.alias('currentUser.staff'), search(){ + if (this._searching) { + return; + } + this._searching = true; + const router = Discourse.__container__.lookup('router:main'); this.set("q", this.get("searchTerm")); @@ -85,7 +90,7 @@ export default Ember.Controller.extend({ const model = translateResults(results) || {}; router.transientCache('lastSearch', { searchKey, model }, 5); this.set("model", model); - }); + }).finally(() => {this._searching = false}); }, actions: {