From 5d5b74f3edcb6afd0b7430a9836d8c8dd0b7eae8 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 23 Aug 2016 19:59:25 +0300 Subject: [PATCH] if no sorting specificed let search plugins handle --- src/search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/search.js b/src/search.js index 9b7306c7fa..b34704bf47 100644 --- a/src/search.js +++ b/src/search.js @@ -298,10 +298,10 @@ function filterByTimerange(posts, timeRange, timeFilter) { } function sortPosts(posts, data) { - if (!posts.length) { + if (!posts.length || !data.sortBy) { return; } - data.sortBy = data.sortBy || 'timestamp'; + data.sortDirection = data.sortDirection || 'desc'; var direction = data.sortDirection === 'desc' ? 1 : -1;