FIX: not counting new/unread on categories

This commit is contained in:
Sam 2015-09-16 17:41:53 +10:00
parent afdb15f99f
commit 66ec6b6e17

View File

@ -276,15 +276,17 @@ const TopicTrackingState = Discourse.Model.extend({
this.lookupCount("unread", category);
}
let categoryId = category ? Em.get(category, "id") : null;
let categoryName = category ? Em.get(category, "name") : null;
if (name === "new") {
return this.countNew(categoryName);
return this.countNew(categoryId);
} else if (name === "unread") {
return this.countUnread(categoryName);
return this.countUnread(categoryId);
} else {
categoryName = name.split("/")[1];
if (categoryName) {
return this.countCategory(categoryName);
return this.countCategory(categoryId);
}
}
},