mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: guard against null billing plan cache entries
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user