Dashboard V2: Fix extraneous tiers on /payments screen
This commit is contained in:
parent
3b142fe0d6
commit
599bdc1338
|
@ -19,14 +19,20 @@ const aggregatePlansAndLimits = (plans, limits, { includeFreePlan }) => {
|
||||||
|
|
||||||
// Decorate each plan with its corresponding limits data, if available.
|
// Decorate each plan with its corresponding limits data, if available.
|
||||||
if (limits?.length) {
|
if (limits?.length) {
|
||||||
return limits.map((limitsDescriptor, index) => {
|
return limits
|
||||||
const asssociatedPlan = sortedPlans.find((plan) => plan.tier === index) || {};
|
.map((limitsDescriptor, index) => {
|
||||||
|
const asssociatedPlan = sortedPlans.find((plan) => plan.tier === index);
|
||||||
|
|
||||||
|
if (asssociatedPlan) {
|
||||||
return {
|
return {
|
||||||
...asssociatedPlan,
|
...asssociatedPlan,
|
||||||
limits: limitsDescriptor || null,
|
limits: limitsDescriptor || null,
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
})
|
||||||
|
.filter(Boolean);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we don't have the limits data yet, set just return the plans.
|
// If we don't have the limits data yet, set just return the plans.
|
||||||
|
|
Reference in New Issue