Skip to content

Commit a7cbc36

Browse files
Mark JessopMark Jessop
authored andcommitted
Merge branch 'testing' of github.com:projecthorus/sondehub-tracker into testing
2 parents bed4719 + 6df60f5 commit a7cbc36

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

js/tracker.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4504,6 +4504,11 @@ function updateLeaderboardPane(r){
45044504
var hunters = r.chaser_count;
45054505
var top = r.top_chasers;
45064506

4507+
// create a sorted list
4508+
top = Object.keys(top).map(function(key){return [key, top[key]]});
4509+
top.sort(function(a, b) {
4510+
return a[1] < b[1]
4511+
});
45074512

45084513
html += "<div><b>Total sondes recovered: " + recovered + "/" + total + "</b></div>";
45094514
html += "<div><b>Total hunters: " + hunters + "</b></div><br>";
@@ -4512,7 +4517,7 @@ function updateLeaderboardPane(r){
45124517
var i = 1;
45134518
for (let chaser in top) {
45144519
if (top.hasOwnProperty(chaser)) {
4515-
html += "<div><b>" + parseInt(i) + ". </b>" + chaser + " - " + top[chaser] + "</div>";
4520+
html += "<div><b>" + parseInt(i) + ". </b>" + top[chaser][0] + " - " + top[chaser][1] + "</div>";
45164521
i+=1;
45174522
}
45184523
}

0 commit comments

Comments
 (0)