From b43ac391a39d4284dab9fe8ba57c03453fa5d016 Mon Sep 17 00:00:00 2001 From: MGCounts <68518563+mgcountss@users.noreply.github.com> Date: Tue, 17 Sep 2024 23:02:16 -0500 Subject: [PATCH] fixed fire emojis not reflecting the selected type --- top50/index.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/top50/index.js b/top50/index.js index 56f6d43..27e81d3 100644 --- a/top50/index.js +++ b/top50/index.js @@ -637,7 +637,18 @@ function update(doGains = true) { document.getElementById("styles").innerHTML = ``; } for (let q = 0; q < data.fireIcons.created.length; q++) { - if (data.fireIcons.created[q].threshold <= data.data[i].count) { + let equation = false; + //either gain or total + if (data.fireIcons.type == 'total') { + if (data.data[i].count >= data.fireIcons.created[q].threshold) { + equation = true; + } + } else if (data.fireIcons.type == 'gain') { + if ((data.data[i].count - data.data[i].lastCount) >= data.fireIcons.created[q].threshold) { + equation = true; + } + } + if (equation) { let icon = data.fireIcons.created[q].icon; let fire = document.createElement('img'); fire.classList = 'fireIcon'; @@ -666,6 +677,8 @@ function update(doGains = true) { } else { currentCard.children[0].innerHTML = `
#${num}
`; } + } else { + currentCard.children[0].innerHTML = `
#${num}
`; } } } else {