FIX: show create new topic link when there are no search results

This commit is contained in:
Arpit Jalan 2018-01-10 13:31:09 +05:30
parent 114294d899
commit 8ad6d8385b
2 changed files with 3 additions and 1 deletions

View File

@ -231,6 +231,7 @@ export default Ember.Controller.extend({
} }
}else{ }else{
setTransient('lastSearch', { searchKey, model }, 5); setTransient('lastSearch', { searchKey, model }, 5);
model.grouped_search_result = results.grouped_search_result;
this.set("model", model); this.set("model", model);
} }
}).finally(() => { }).finally(() => {

View File

@ -36,7 +36,8 @@ export default Discourse.Route.extend({
return null; return null;
} }
}).then(results => { }).then(results => {
const model = (results && translateResults(results)) || {}; const grouped_search_result = results ? results.grouped_search_result : {};
const model = (results && translateResults(results)) || { grouped_search_result };
setTransient('lastSearch', { searchKey, model }, 5); setTransient('lastSearch', { searchKey, model }, 5);
return model; return model;
}); });