From 84c6c2b48c2f32c5b4df7e9279d1c199e1caf889 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 17 Aug 2015 10:52:41 +1000 Subject: [PATCH] correct logic --- .../javascripts/discourse/controllers/search.js.es6 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/search.js.es6 b/app/assets/javascripts/discourse/controllers/search.js.es6 index 25930fe4e83..63806949456 100644 --- a/app/assets/javascripts/discourse/controllers/search.js.es6 +++ b/app/assets/javascripts/discourse/controllers/search.js.es6 @@ -40,11 +40,12 @@ export default Em.Controller.extend({ let url = '/search?q=' + encodeURIComponent(this.get('term')); const searchContext = this.get('searchContext'); - if (this.get('searchContextEnabled') && - searchContext.id.toLowerCase() === this.get('currentUser.username_lower')) { - url += ' in:private'; - } else { - url += encodeURIComponent(" " + searchContext.type + ":" + searchContext.id); + if (this.get('searchContextEnabled')) { + if (searchContext.id.toLowerCase() === this.get('currentUser.username_lower')) { + url += ' in:private'; + } else { + url += encodeURIComponent(" " + searchContext.type + ":" + searchContext.id); + } } return url;