partial fix for suggested js error

This commit is contained in:
Sam 2013-06-12 15:24:45 +10:00
parent 201891f51f
commit d5b07464ea
2 changed files with 9 additions and 4 deletions

View File

@ -87,9 +87,14 @@ Discourse.TopicList.reopenClass({
// the new topics loaded from the server
var newTopics = Discourse.TopicList.topicsFrom(result);
defer.resolve(topic_ids.map(function(id){
return newTopics.find(function(t){ return t.id === id; });
}));
var topics = _(topic_ids)
.map(function(id){
return newTopics.find(function(t){ return t.id === id; });
})
.without(undefined)
.value();
defer.resolve(topics);
} else {
defer.reject();
}

View File

@ -143,7 +143,7 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
if(suggested) {
var existing = _(suggested).map(function(topic){
var existing = _.map(suggested, function(topic){
return topic.get("id");
});