Skip to content

Commit

Permalink
cleanup: simplify limit checks in OrgUpdateAlert component
Browse files Browse the repository at this point in the history
  • Loading branch information
vid277 authored and skeptrunedev committed Jan 8, 2025
1 parent d64bd2e commit 3f953b7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontends/dashboard/src/components/OrgUpdateAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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).`,
);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 3f953b7

Please sign in to comment.