Skip to content

Node.js based forum software built for the modern web

#2886 Check subcategories when showing category recent topics

EvSpirit2ea840e65dc0
diff --git a/src/categories/recentreplies.js b/src/categories/recentreplies.js
index 11b16897fc..bd6871ce99 100644
--- a/src/categories/recentreplies.js
+++ b/src/categories/recentreplies.js
@@ -61,8 +61,8 @@ module.exports = function(Categories) {
function assignPostsToCategory(category, posts) {
category.posts = posts.filter(function(post) {
- return !!(post.category && (parseInt(post.category.cid, 10) === parseInt(category.cid, 10)
- ) || (parseInt(post.category.parentCid, 10) === parseInt(category.cid, 10)));
+ return post.category && (parseInt(post.category.cid, 10) === parseInt(category.cid, 10)
+ || parseInt(post.category.parentCid, 10) === parseInt(category.cid, 10));
}).sort(function(a, b) {
return b.timestamp - a.timestamp;
}).slice(0, parseInt(category.numRecentReplies, 10));