From 55e990f71d5b3953f851b4be3703bbee46209861 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 22 Oct 2013 21:20:56 -0400 Subject: [PATCH] fixes #433 - looks like someone removed the code that floated pinned topics to the top... --- src/categories.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/categories.js b/src/categories.js index 9833720896..6a67d34775 100644 --- a/src/categories.js +++ b/src/categories.js @@ -87,6 +87,11 @@ var RDB = require('./redis.js'), function getTopics(next) { topics.getTopicsByTids(tids, current_user, function(topicsData) { + // Float pinned topics to the top of the list + topicsData = topicsData.sort(function(a, b) { + return parseInt(b.pinned, 10) - parseInt(a.pinned, 10); + }); + next(null, topicsData); }, category_id); }