From b9d4b02780f522a1122358f75ef434ff6f49e4fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= <baris@nodebb.org> Date: Sat, 9 Dec 2017 15:21:17 -0500 Subject: [PATCH] sort tags by score --- src/topics/tags.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/topics/tags.js b/src/topics/tags.js index f936d7da4a..4561c950fa 100644 --- a/src/topics/tags.js +++ b/src/topics/tags.js @@ -253,6 +253,9 @@ module.exports = function (Topics) { topicTags.forEach(function (tags, index) { if (Array.isArray(tags)) { topicTags[index] = tags.map(function (tag) { return tagData[tag]; }); + topicTags[index].sort(function (tag1, tag2) { + return tag2.score - tag1.score; + }); } });