fix(billing): fix error when currentPlan or organization is undefined

When going from /account to /organization/[organization]/change-plan,
the currentPlan and organization variables may not be defined as the
states are still being set. This change ensures an error isn't thrown
so that the states can update fully.
This commit is contained in:
Steven Nguyen
2025-05-22 16:31:25 -07:00
parent 1d8458084a
commit 2a6dbc729f
@@ -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;
</script>
<svelte:head>