From bc0baac9bcbc60e86780b5b8fed904c8b40bba6e Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Thu, 5 Jun 2025 17:14:46 -0700 Subject: [PATCH 1/3] fix: update isNewOrg logic on apply-credit page The logic was for an existing org, but the variable name was isNewOrg. This commit updates the logic to match the variable name. --- src/routes/(console)/apply-credit/+page.svelte | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/routes/(console)/apply-credit/+page.svelte b/src/routes/(console)/apply-credit/+page.svelte index 1c86a2c5d..9f18e6cd8 100644 --- a/src/routes/(console)/apply-credit/+page.svelte +++ b/src/routes/(console)/apply-credit/+page.svelte @@ -246,14 +246,12 @@ billingPlan = getBillingPlan(); } - $: isNewOrg = selectedOrgId && selectedOrgId !== newOrgId; + $: isNewOrg = !(selectedOrgId && selectedOrgId !== newOrgId); - $: { - if (isNewOrg) { - (async () => { - currentPlan = await sdk.forConsole.billing.getOrganizationPlan(selectedOrgId); - })(); - } + $: if (!isNewOrg) { + (async () => { + currentPlan = await sdk.forConsole.billing.getOrganizationPlan(selectedOrgId); + })(); } // after adding a payment method, fetch the payment methods again so the input can be updated @@ -371,7 +369,7 @@ {collaborators} bind:couponData bind:billingBudget - organizationId={isNewOrg ? selectedOrgId : null}> + organizationId={!isNewOrg ? selectedOrgId : null}> {#if campaign?.template === 'review' && (campaign?.cta || campaign?.claimed || campaign?.unclaimed)}

{campaign?.cta}

From ea5dc1fae5a23d28f4134c8e76c25a5533329044 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Thu, 5 Jun 2025 17:18:45 -0700 Subject: [PATCH 2/3] fix: reload payment methods if organization changes This ensures the payment method input is updated to the newly selected organization's payment method after switching. --- src/routes/(console)/apply-credit/+page.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/routes/(console)/apply-credit/+page.svelte b/src/routes/(console)/apply-credit/+page.svelte index 9f18e6cd8..fe352d4a7 100644 --- a/src/routes/(console)/apply-credit/+page.svelte +++ b/src/routes/(console)/apply-credit/+page.svelte @@ -252,6 +252,7 @@ (async () => { currentPlan = await sdk.forConsole.billing.getOrganizationPlan(selectedOrgId); })(); + loadPaymentMethods(); } // after adding a payment method, fetch the payment methods again so the input can be updated From 6a5363efbf35998e90334b06e1ae0e6581329fc3 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Thu, 5 Jun 2025 17:58:15 -0700 Subject: [PATCH 3/3] fix: prevent updating plan without coupon on apply credits page --- src/routes/(console)/apply-credit/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(console)/apply-credit/+page.svelte b/src/routes/(console)/apply-credit/+page.svelte index fe352d4a7..9076f2824 100644 --- a/src/routes/(console)/apply-credit/+page.svelte +++ b/src/routes/(console)/apply-credit/+page.svelte @@ -396,7 +396,7 @@ handleSubmit(); } }} - disabled={$isSubmitting}> + disabled={!couponData?.code || $isSubmitting}> {#if $isSubmitting}