From aaf9885b2f08d02dc0b74769450a9c99c832c7fe Mon Sep 17 00:00:00 2001 From: Darshan Date: Wed, 5 Mar 2025 12:04:34 +0530 Subject: [PATCH] Revert "Console Feat: make budget cap nullable" --- src/routes/(console)/create-organization/+page.svelte | 2 +- .../organization-[organization]/billing/+page.svelte | 2 ++ .../billing/budgetAlert.svelte | 10 ++-------- .../billing/budgetCap.svelte | 7 ++----- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/routes/(console)/create-organization/+page.svelte b/src/routes/(console)/create-organization/+page.svelte index a9a92035e..621ba3a00 100644 --- a/src/routes/(console)/create-organization/+page.svelte +++ b/src/routes/(console)/create-organization/+page.svelte @@ -170,7 +170,7 @@ trackEvent(Submit.OrganizationCreate, { plan: tierToPlan(billingPlan)?.name, - budget_cap_enabled: billingBudget !== null, + budget_cap_enabled: !!billingBudget, members_invited: collaborators?.length }); diff --git a/src/routes/(console)/organization-[organization]/billing/+page.svelte b/src/routes/(console)/organization-[organization]/billing/+page.svelte index 2d3772358..c370fbf31 100644 --- a/src/routes/(console)/organization-[organization]/billing/+page.svelte +++ b/src/routes/(console)/organization-[organization]/billing/+page.svelte @@ -1,6 +1,7 @@
@@ -110,7 +107,6 @@
diff --git a/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte b/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte index df6a7e84a..b9c9b5eb3 100644 --- a/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte +++ b/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte @@ -9,14 +9,13 @@ import { organization, currentPlan } from '$lib/stores/organization'; import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; - import BudgetAlert from './budgetAlert.svelte'; let capActive = false; let budget: number; onMount(() => { budget = $organization?.billingBudget; - capActive = $organization?.billingBudget !== null; + capActive = !!$organization?.billingBudget; }); async function updateBudget() { @@ -45,7 +44,7 @@ } $: if (!capActive) { - budget = null; + budget = 0; } @@ -114,5 +113,3 @@ - - 0} />