mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-05 03:51:26 +01:00
fixed live tiles if there are more than 2 posts
This commit is contained in:
@@ -277,7 +277,7 @@ var RDB = require('./redis.js'),
|
||||
}
|
||||
|
||||
Categories.getRecentReplies = function(cid, count, callback) {
|
||||
RDB.zrevrange('categories:recent_posts:cid:' + cid, 0, count, function(err, pids) {
|
||||
RDB.zrevrange('categories:recent_posts:cid:' + cid, 0, count-1, function(err, pids) {
|
||||
|
||||
if (pids.length == 0) {
|
||||
callback([]);
|
||||
|
||||
@@ -192,7 +192,7 @@ var express = require('express'),
|
||||
function iterator(category, callback) {
|
||||
categories.getRecentReplies(category.cid, 2, function(posts) {
|
||||
category["posts"] = posts;
|
||||
category["post_count"] = posts.length;
|
||||
category["post_count"] = posts.length>2 ? 2 : posts.length;
|
||||
callback(null);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user