Skip to content

Commit a8ea415

Browse files
committed
fix: logic breaking on self-hosted instances.
1 parent 067d10b commit a8ea415

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/lib/components/breadcrumbs.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
254254
let badgeType: 'success' | undefined;
255255
$: badgeType =
256-
$organization && $organization.billingPlanDetails.group !== BillingPlanGroup.Starter
256+
$organization && $organization?.billingPlanDetails?.group !== BillingPlanGroup.Starter
257257
? 'success'
258258
: undefined;
259259
</script>

src/lib/stores/billing.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ export function checkForProjectLimitation(plan: string, id: PlanServices) {
302302

303303
export function isServiceLimited(serviceId: PlanServices, plan: string, total: number) {
304304
if (!total) return false;
305+
if (!plan) return false;
305306
const limit = getServiceLimit(serviceId) || Infinity;
306307
const isLimited = limit !== 0 && limit < Infinity;
307308
const hasUsageFees = checkForUsageFees(plan, serviceId);

src/routes/(console)/organization-[organization]/members/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
4545
// Calculate if button should be disabled and tooltip should show
4646
$: memberCount = data.organizationMembers?.total ?? 0;
47-
$: supportsMembers = $organization?.billingPlanDetails.addons.seats;
47+
$: supportsMembers = $organization?.billingPlanDetails?.addons?.seats;
4848
$: isFreeWithMembers = !supportsMembers && memberCount >= 1;
4949
$: isButtonDisabled = isCloud ? isFreeWithMembers : false;
5050

src/routes/(console)/project-[region]-[project]/databases/database-[database]/backups/locked.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
title="Policies"
2424
buttonText="Create policy"
2525
buttonType="secondary"
26-
buttonDisabled={true} />
26+
buttonDisabled />
2727

2828
<img
2929
src={$app.themeInUse === 'dark'
@@ -41,7 +41,7 @@
4141
title="Policies"
4242
buttonText="Create policy"
4343
buttonType="secondary"
44-
buttonDisabled={true} />
44+
buttonDisabled />
4545

4646
<img
4747
src={$app.themeInUse === 'dark'
@@ -60,15 +60,15 @@
6060
title="Policies"
6161
buttonText="Create policy"
6262
buttonType="secondary"
63-
buttonDisabled={true} />
63+
buttonDisabled />
6464
</div>
6565

6666
<div style="width: 69%; padding-inline-start: 1.5rem;">
6767
<ContainerHeader
6868
title="Backups"
6969
buttonText="Manual backup"
7070
buttonType="secondary"
71-
buttonDisabled={true} />
71+
buttonDisabled />
7272
</div>
7373
</div>
7474

0 commit comments

Comments
 (0)