Browse Source

Fun: stable sorting for same-day block-height items

master
Dan Janosik 5 years ago
parent
commit
96f2f94d69
No known key found for this signature in database GPG Key ID: C6F8CE9FFDB2CED2
  1. 13
      routes/baseActionsRouter.js

13
routes/baseActionsRouter.js

@ -1520,7 +1520,18 @@ router.get("/fun", function(req, res, next) {
return -1; return -1;
} else { } else {
return a.type.localeCompare(b.type); var x = a.type.localeCompare(b.type);
if (x == 0) {
if (a.type == "blockheight") {
return a.blockHeight - b.blockHeight;
} else {
return x;
}
}
return x;
} }
}); });

Loading…
Cancel
Save