diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index cdd3fc53bc..3454d2ba71 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -143,7 +143,7 @@ export function getBasePlanFromGroup(billingPlanGroup: BillingPlanGroup): Models const plansInfoStore = getPlansInfoStore(); const proPlans = Array.from(plansInfoStore.values()).filter( - (plan) => plan.group === billingPlanGroup + (plan): plan is Models.BillingPlan => !!plan && plan.group === billingPlanGroup ); return proPlans.sort((a, b) => a.order - b.order)[0]; diff --git a/src/routes/(console)/project-[region]-[project]/+layout.ts b/src/routes/(console)/project-[region]-[project]/+layout.ts index 8da51bb512..1bec6520ec 100644 --- a/src/routes/(console)/project-[region]-[project]/+layout.ts +++ b/src/routes/(console)/project-[region]-[project]/+layout.ts @@ -99,7 +99,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => { loadFailedInvoices(project.teamId); } - if (!includedInBasePlans) { + if (!includedInBasePlans && organizationPlan) { // save the custom plan to `plansInfo` cache. plansInfo.set(organization.billingPlanId, organizationPlan); }