Fix hiscores name being case sensitive in rank search

This commit is contained in:
dginovker 2021-01-25 14:23:32 -05:00
parent 5969702987
commit 8b45f101f6

View File

@ -103,7 +103,7 @@ hiscores.populatePlayerRanks = (username, result) => {
row.childNodes[1].replaceWith(document.createElement("td"));
row.childNodes[1].className = "rankCol";
let rank = (result[i - 1].findIndex(player => player.username === username) + 1)
let rank = (result[i - 1].findIndex(player => player.username.toLowerCase() === username.toLowerCase()) + 1)
row.childNodes[1].innerHTML = rank ? rank : `<span style="color: rgba(158, 144, 47, 0.5);">Unranked</span>`;
}
}