From fb45b498a2fdae4337b66c805c4db9a965805857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 26 May 2017 18:11:37 -0400 Subject: [PATCH] fix lint --- src/topics/popular.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/topics/popular.js b/src/topics/popular.js index 5b5d3f9402..ee77ef7544 100644 --- a/src/topics/popular.js +++ b/src/topics/popular.js @@ -9,13 +9,15 @@ module.exports = function (Topics) { count = parseInt(count, 10) || 20; if (term === 'alltime') { - return getAllTimePopular(uid, count, function (err, topics) { - if (err) { - return callback(err); + async.waterfall([ + function (next) { + getAllTimePopular(uid, count, next); + }, + function (topics, next) { + sortTiedTopicsByViews(topics, next); } - - sortTiedTopicsByViews(topics, callback); - }); + ], callback); + return; } async.waterfall([