diff --git a/src/lib/components/support.svelte b/src/lib/components/support.svelte index 2520ef032e..d05d2639c3 100644 --- a/src/lib/components/support.svelte +++ b/src/lib/components/support.svelte @@ -28,7 +28,7 @@ (team) => !$plansInfo.get((team as Organization).billingPlan)?.premiumSupport ); - $: upgradeURL = `${base}/organization-${freeOrganization.$id}/change-plan`; + $: upgradeURL = `${base}/organization-${freeOrganization?.$id}/change-plan`; $: supportTimings = `${utcHourToLocaleHour('16:00')} - ${utcHourToLocaleHour('00:00')} ${localeShortTimezoneName()}`; diff --git a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte index 2f63c5532c..ae83f8c261 100644 --- a/src/routes/(console)/organization-[organization]/change-plan/+page.svelte +++ b/src/routes/(console)/organization-[organization]/change-plan/+page.svelte @@ -241,9 +241,9 @@ } } - $: isUpgrade = $plansInfo.get(selectedPlan).order > $currentPlan.order; - $: isDowngrade = $plansInfo.get(selectedPlan).order < $currentPlan.order; - $: isButtonDisabled = $organization.billingPlan === selectedPlan; + $: isUpgrade = $plansInfo.get(selectedPlan).order > $currentPlan?.order; + $: isDowngrade = $plansInfo.get(selectedPlan).order < $currentPlan?.order; + $: isButtonDisabled = $organization?.billingPlan === selectedPlan;