From 7e970940ae349bb418465dedb7f23c0bf20e0984 Mon Sep 17 00:00:00 2001 From: Florian Hartwich Date: Sat, 26 Aug 2017 18:12:42 +0200 Subject: [PATCH] Fix same isMedal state sort --- api/signature-tool/signature-tool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/signature-tool/signature-tool.js b/api/signature-tool/signature-tool.js index 3a249eb..d26fa13 100644 --- a/api/signature-tool/signature-tool.js +++ b/api/signature-tool/signature-tool.js @@ -139,7 +139,7 @@ let addDecorationsAndSave = (userId, loadedImage, res, next) => { //TODO: simplify this sorting hell awardings.sort((a1, a2) => { if (!a1.decorationId.isMedal && !a2.decorationId.isMedal) { - if (a1.decorationId.fraction === 'GLOBAL' && a2.decorationId.fraction === 'GLOBAL') { + if (a1.decorationId.fraction === a2.decorationId.fraction) { if (a1.date !== a2.date) { if (a1.date < a2.date) { return -1;