From 340c3080b38518976c5c833399d8e07a7fc561bf Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 7 Dec 2017 22:24:50 +0100 Subject: show post metadata and thread list --- lib/bucky.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/bucky.js') diff --git a/lib/bucky.js b/lib/bucky.js index bfc4b6f..70910ef 100644 --- a/lib/bucky.js +++ b/lib/bucky.js @@ -21,7 +21,9 @@ var bucky = module.exports = { lookup[c.thread] = c }) res.threads.forEach(function(thread){ - thread.set("comment_count", lookup[thread.id].count) + if (lookup[thread.id]) { + thread.set("comment_count", lookup[thread.id].count) + } }) next() }) @@ -58,7 +60,7 @@ var bucky = module.exports = { }) }, ensureHootbox: function (req, res, next){ - db.getCommentsForThread(1, 9, 0, "desc").then(function(hootbox){ + db.getCommentsForThread(1, 15, 0, "desc").then(function(hootbox){ res.hootbox = hootbox next() }) -- cgit v1.2.3-70-g09d2