fix stats loading
This commit is contained in:
parent
87da31e65b
commit
a563733b99
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue