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']
|
InstanceInsightsSchema['creationArchiveTrends']
|
||||||
>,
|
>,
|
||||||
) {
|
) {
|
||||||
if (
|
if (!groupedCreationArchiveData) {
|
||||||
!groupedCreationArchiveData ||
|
|
||||||
Object.keys(groupedCreationArchiveData).length === 0
|
|
||||||
) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,7 +21,7 @@ function getCurrentArchiveRatio(
|
|||||||
let totalCreated = 0;
|
let totalCreated = 0;
|
||||||
|
|
||||||
Object.values(groupedCreationArchiveData).forEach((projectData) => {
|
Object.values(groupedCreationArchiveData).forEach((projectData) => {
|
||||||
const latestData = projectData[projectData.length - 1];
|
const latestData = projectData[0];
|
||||||
if (latestData) {
|
if (latestData) {
|
||||||
totalArchived += latestData.archivedFlags || 0;
|
totalArchived += latestData.archivedFlags || 0;
|
||||||
const createdSum = latestData.createdFlags
|
const createdSum = latestData.createdFlags
|
||||||
|
Loading…
Reference in New Issue
Block a user