mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-01 13:47:27 +02:00
fix: incorrect current calculation of ratio (#10567)
Looks like the sinner was looking at the last entry of each data list, when they are sorted by most recent first.
This commit is contained in:
parent
016d269675
commit
709a890bd8
@ -13,10 +13,7 @@ function getCurrentArchiveRatio(
|
||||
InstanceInsightsSchema['creationArchiveTrends']
|
||||
>,
|
||||
) {
|
||||
if (
|
||||
!groupedCreationArchiveData ||
|
||||
Object.keys(groupedCreationArchiveData).length === 0
|
||||
) {
|
||||
if (!groupedCreationArchiveData) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -24,7 +21,7 @@ function getCurrentArchiveRatio(
|
||||
let totalCreated = 0;
|
||||
|
||||
Object.values(groupedCreationArchiveData).forEach((projectData) => {
|
||||
const latestData = projectData[projectData.length - 1];
|
||||
const latestData = projectData[0];
|
||||
if (latestData) {
|
||||
totalArchived += latestData.archivedFlags || 0;
|
||||
const createdSum = latestData.createdFlags
|
||||
|
Loading…
Reference in New Issue
Block a user