Skip to content

Commit bcbb07c

Browse files
committed
Minor code rabbit suggested fixes
1 parent b6bcd0e commit bcbb07c

File tree

2 files changed

+3
-3
lines changed
  • apps/webapp/app/routes
    • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches
    • _app.orgs.$organizationSlug.settings.team

2 files changed

+3
-3
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,6 @@ function PurchaseBranchesModal({
652652
triggerButton?: React.ReactNode;
653653
}) {
654654
const lastSubmission = useActionData();
655-
const organization = useOrganization();
656655
const [form, { amount }] = useForm({
657656
id: "purchase-branches",
658657
lastSubmission: lastSubmission as any,

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.team/route.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ export default function Page() {
211211

212212
const plan = useCurrentPlan();
213213
const requiresUpgrade = limits.used >= limits.limit;
214+
const usageRatio = limits.limit > 0 ? Math.min(limits.used / limits.limit, 1) : 0;
214215
const canUpgrade =
215216
plan?.v3Subscription?.plan && !plan.v3Subscription.plan.limits.teamMembers.canExceed;
216217

@@ -339,14 +340,14 @@ export default function Page() {
339340
r="10"
340341
cx="12"
341342
cy="12"
342-
strokeDasharray={`${(limits.used / limits.limit) * 62.8} 62.8`}
343+
strokeDasharray={`${usageRatio * 62.8} 62.8`}
343344
strokeDashoffset="0"
344345
strokeLinecap="round"
345346
/>
346347
</svg>
347348
</div>
348349
}
349-
content={`${Math.round((limits.used / limits.limit) * 100)}%`}
350+
content={`${Math.round(usageRatio * 100)}%`}
350351
/>
351352
<div className="flex w-full items-center justify-between gap-6">
352353
{requiresUpgrade ? (

0 commit comments

Comments
 (0)