Skip to content

Node.js based forum software built for the modern web

fixes #433 - looks like someone removed the code that floated pinned topics to the top...

Julian Lam55e990f71d5b
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);
}