1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-24 17:51:14 +02:00

fix: incorrect current calculation of ratio

This commit is contained in:
Thomas Heartman 2025-08-28 15:37:23 +02:00
parent b071b17dd6
commit 7972fb00af
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78

View File

@ -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