Merge pull request #2105 from SkynetLabs/michalleszczyk/sky-652-fix-subscription-plans-view
Dashboard V2: Fix extraneous tiers on /payments screen
This commit is contained in:
commit
98d6884391
|
@ -19,14 +19,20 @@ const aggregatePlansAndLimits = (plans, limits, { includeFreePlan }) => {
|
|||
|
||||
// Decorate each plan with its corresponding limits data, if available.
|
||||
if (limits?.length) {
|
||||
return limits.map((limitsDescriptor, index) => {
|
||||
const asssociatedPlan = sortedPlans.find((plan) => plan.tier === index) || {};
|
||||
return limits
|
||||
.map((limitsDescriptor, index) => {
|
||||
const asssociatedPlan = sortedPlans.find((plan) => plan.tier === index);
|
||||
|
||||
return {
|
||||
...asssociatedPlan,
|
||||
limits: limitsDescriptor || null,
|
||||
};
|
||||
});
|
||||
if (asssociatedPlan) {
|
||||
return {
|
||||
...asssociatedPlan,
|
||||
limits: limitsDescriptor || null,
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
})
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
||||
// If we don't have the limits data yet, set just return the plans.
|
||||
|
|
Reference in New Issue