diff --git a/src/lib/components/billing/selectPaymentMethod.svelte b/src/lib/components/billing/selectPaymentMethod.svelte index dac287731f..7dfe14a2ed 100644 --- a/src/lib/components/billing/selectPaymentMethod.svelte +++ b/src/lib/components/billing/selectPaymentMethod.svelte @@ -21,6 +21,7 @@ async function cardSaved(event: CustomEvent) { value = event.detail.$id; invalidate(Dependencies.UPGRADE_PLAN); + invalidate(Dependencies.CREATE_ORGANIZATION); } onMount(() => { diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 58ae2e443b..067b354dd9 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -18,6 +18,7 @@ export enum Dependencies { INVOICES = 'dependency:invoices', ADDRESS = 'dependency:address', UPGRADE_PLAN = 'dependency:upgrade_plan', + CREATE_ORGANIZATION = 'dependency:create_organization', PAYMENT_METHODS = 'dependency:paymentMethods', ORGANIZATION = 'dependency:organization', MEMBERS = 'dependency:members', diff --git a/src/routes/(console)/create-organization/+page.svelte b/src/routes/(console)/create-organization/+page.svelte index 5599131ceb..77049390e7 100644 --- a/src/routes/(console)/create-organization/+page.svelte +++ b/src/routes/(console)/create-organization/+page.svelte @@ -213,20 +213,29 @@ {#if selectedPlan !== BillingPlan.FREE}
- - - {#if !selectedCoupon?.code} - - - {/if} - - + + + + {#if !selectedCoupon?.code && paymentMethodId} + + + {/if} + + + + {#if !selectedCoupon?.code && !paymentMethodId} + + {/if} +
{ +export const load: PageLoad = async ({ url, parent, depends }) => { + depends(Dependencies.CREATE_ORGANIZATION); const { organizations } = await parent(); const [coupon, paymentMethods] = await Promise.all([ getCoupon(url),