fixed live tiles if there are more than 2 posts

v1.18.x
Baris Soner Usakli 12 years ago
parent 642bd5f3c8
commit 9320883f92

@ -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);
});
}

Loading…
Cancel
Save