mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +01:00
if no sorting specificed let search plugins handle
This commit is contained in:
@@ -298,10 +298,10 @@ function filterByTimerange(posts, timeRange, timeFilter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function sortPosts(posts, data) {
|
function sortPosts(posts, data) {
|
||||||
if (!posts.length) {
|
if (!posts.length || !data.sortBy) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data.sortBy = data.sortBy || 'timestamp';
|
|
||||||
data.sortDirection = data.sortDirection || 'desc';
|
data.sortDirection = data.sortDirection || 'desc';
|
||||||
var direction = data.sortDirection === 'desc' ? 1 : -1;
|
var direction = data.sortDirection === 'desc' ? 1 : -1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user