diff --git a/src/routes/(console)/apply-credit/+page.svelte b/src/routes/(console)/apply-credit/+page.svelte index 1c86a2c5d..9076f2824 100644 --- a/src/routes/(console)/apply-credit/+page.svelte +++ b/src/routes/(console)/apply-credit/+page.svelte @@ -246,14 +246,13 @@ 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); + })(); + loadPaymentMethods(); } // after adding a payment method, fetch the payment methods again so the input can be updated @@ -371,7 +370,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}
@@ -397,7 +396,7 @@ handleSubmit(); } }} - disabled={$isSubmitting}> + disabled={!couponData?.code || $isSubmitting}> {#if $isSubmitting}