From 0d1c86777ca471f6e8f2131e28f127ea74aa3c03 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 8 Jan 2025 09:26:44 +0000 Subject: [PATCH] Fix usage calculations --- packages/builder/src/stores/portal/licensing.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/stores/portal/licensing.ts b/packages/builder/src/stores/portal/licensing.ts index 0b56e14005..99970313e2 100644 --- a/packages/builder/src/stores/portal/licensing.ts +++ b/packages/builder/src/stores/portal/licensing.ts @@ -227,7 +227,7 @@ class LicensingStore extends BudiStore { MonthlyQuotaName.AUTOMATIONS, ].reduce((acc: MonthlyMetrics, key) => { const limit = license.quotas.usage.monthly[key].value - const used = (usage.monthly.current?.[key] || 0 / limit) * 100 + const used = ((usage.monthly.current?.[key] || 0) / limit) * 100 acc[key] = limit > -1 ? Math.floor(used) : -1 return acc }, {}) @@ -236,7 +236,7 @@ class LicensingStore extends BudiStore { const staticMetrics = [StaticQuotaName.APPS, StaticQuotaName.ROWS].reduce( (acc: StaticMetrics, key) => { const limit = license.quotas.usage.static[key].value - const used = (usage.usageQuota[key] || 0 / limit) * 100 + const used = ((usage.usageQuota[key] || 0) / limit) * 100 acc[key] = limit > -1 ? Math.floor(used) : -1 return acc },