Hiscores - Fix icon and hiscore category not updating when looking at the hiscores for a specific skill

This commit is contained in:
dginovker 2023-08-20 09:36:25 -04:00
parent 9e6a9935ef
commit a4e97249e5

View File

@ -991,6 +991,8 @@ hiscores.populatePlayerRankByIndex = (username, result, i) => {
}
hiscores.loadSkillTable = (skillId) => {
hiscores.setHeadSkillText(hiscores.sName[skillId]);
hiscores.setHeadSkillIcon(hiscores.sName[skillId]);
fetch(`${hiscores.apiURL}/hiscores/playersBySkill/${hiscores.world}/${skillId}`)
.then(response => response.json())
.then(result => {
@ -1016,9 +1018,6 @@ hiscores.loadSkillTable = (skillId) => {
}
hiscores.populateSkillHSTable = () => {
hiscores.setHeadSkillText(hiscores.sName[hiscores.currentSkillId]);
hiscores.setHeadSkillIcon(hiscores.sName[hiscores.currentSkillId]);
for (let i = 1; i <= 24; i++) {
row = document.getElementsByClassName(`row row${i}`)[0];
const playerData = hiscores.tableData[i + 24 * hiscores.page - 1];