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:
parent
b071b17dd6
commit
7972fb00af
@ -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