From 01b4dd1d94cece7c048bf9db5cb6272ddc34ca9f Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 23 Dec 2024 14:09:37 +0100 Subject: [PATCH] Switch to if statement setup --- src/routes/(console)/apply-credit/+page.svelte | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/routes/(console)/apply-credit/+page.svelte b/src/routes/(console)/apply-credit/+page.svelte index 9bc53d5cb..df8a16bf9 100644 --- a/src/routes/(console)/apply-credit/+page.svelte +++ b/src/routes/(console)/apply-credit/+page.svelte @@ -190,17 +190,11 @@ (team) => team.$id === selectedOrgId ) as Organization; - function getNewBillingPlan(organization: Organization): BillingPlan { - if (organization?.billingPlan === BillingPlan.SCALE) { - return BillingPlan.SCALE; - } else if (campaign?.plan) { - return campaign.plan; - } else { - return BillingPlan.PRO; - } + $: if (selectedOrg?.billingPlan === BillingPlan.SCALE) { + billingPlan = BillingPlan.SCALE; + } else if (campaign?.plan) { + billingPlan = campaign.plan; } - - $: billingPlan = getNewBillingPlan(selectedOrg);