From 3f953b71917defb143d4ef38b437e66e4370447f Mon Sep 17 00:00:00 2001 From: Vidyoot Senthil Date: Mon, 6 Jan 2025 17:42:30 -0600 Subject: [PATCH] cleanup: simplify limit checks in OrgUpdateAlert component --- frontends/dashboard/src/components/OrgUpdateAlert.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontends/dashboard/src/components/OrgUpdateAlert.tsx b/frontends/dashboard/src/components/OrgUpdateAlert.tsx index 65d0df584..0039da2d9 100644 --- a/frontends/dashboard/src/components/OrgUpdateAlert.tsx +++ b/frontends/dashboard/src/components/OrgUpdateAlert.tsx @@ -37,7 +37,7 @@ const OrgUpdateAlert = () => { `Your organization has reached its total ${variableName} limit (${percentageUsed}% used).`, ); setAlertState(AlertState.Danger); - } else if (currentCount >= Math.floor(subscriptionLimit * 0.8)) { + } else if (currentCount >= subscriptionLimit * 0.8) { setMessage( `Your organization is approaching its total ${variableName} limit (${percentageUsed}% used).`, ); @@ -78,8 +78,7 @@ const OrgUpdateAlert = () => { ]; const approachingUsage = OrganizationUsageVariables.find( - ({ current, limit }) => - current >= limit || current >= Math.floor(limit * 0.8), + ({ current, limit }) => current >= limit || current >= limit * 0.8, ); if (approachingUsage) {