diff --git a/app/assets/javascripts/discourse/controllers/search_controller.js b/app/assets/javascripts/discourse/controllers/search_controller.js index 99ef1e5d8f0..bfaefd20fb6 100644 --- a/app/assets/javascripts/discourse/controllers/search_controller.js +++ b/app/assets/javascripts/discourse/controllers/search_controller.js @@ -40,7 +40,7 @@ Discourse.SearchController = Em.ArrayController.extend(Discourse.Presence, { .map(function(n){ return _(results).where({type: n}).first() }) - .without(undefined) + .compact() .each(function(list){ _.each(list.results, function(item){ item.index = index++; diff --git a/app/assets/javascripts/discourse/models/topic_list.js b/app/assets/javascripts/discourse/models/topic_list.js index 8fc47ae94e4..3563e11c3ef 100644 --- a/app/assets/javascripts/discourse/models/topic_list.js +++ b/app/assets/javascripts/discourse/models/topic_list.js @@ -91,7 +91,7 @@ Discourse.TopicList.reopenClass({ .map(function(id){ return newTopics.find(function(t){ return t.id === id; }); }) - .without(undefined) + .compact() .value(); defer.resolve(topics);