mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 16:27:27 +02:00
sorting
This commit is contained in:
@@ -95,7 +95,12 @@ var RDB = require('./redis.js'),
|
||||
|
||||
// Float pinned topics to the top
|
||||
topics = topics.sort(function(a, b) {
|
||||
return b.pinned - a.pinned;
|
||||
if (a.pinned !== b.pinned) return b.pinned - a.pinned;
|
||||
else {
|
||||
console.log('here');
|
||||
// Sort by datetime descending
|
||||
return b.timestamp - a.timestamp;
|
||||
}
|
||||
});
|
||||
|
||||
callback({
|
||||
|
||||
Reference in New Issue
Block a user