fix stats loading

This commit is contained in:
saml33 2022-06-30 07:58:28 +10:00
parent 87da31e65b
commit a563733b99
1 changed files with 5 additions and 5 deletions

View File

@ -40,11 +40,11 @@ const getAverageStats = (
) )
const oldestStat = timeFilteredStats[0] const oldestStat = timeFilteredStats[0]
const latestStat = timeFilteredStats[timeFilteredStats.length - 1] const latestStat = timeFilteredStats[timeFilteredStats.length - 1]
const avg = let avg
latestStat[type] && oldestStat[type] if (type in latestStat && type in oldestStat) {
? Math.pow(latestStat[type] / oldestStat[type], 365 / daysAgo) * 100 - avg =
100 Math.pow(latestStat[type] / oldestStat[type], 365 / daysAgo) * 100 - 100
: null }
priorDate.setHours(priorDate.getHours() + 1) priorDate.setHours(priorDate.getHours() + 1)