mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 22:02:11 +03:00
Fixed default plan for complimentary members
refs https://github.com/TryGhost/members.js/issues/77 - Fixes members on complimentary plan not having a default plan selected on account plan page
This commit is contained in:
parent
a8d2c03f9c
commit
b563ab05a9
@ -90,8 +90,11 @@ export default class AccountPlanPage extends React.Component {
|
||||
const {member} = this.context;
|
||||
const {plans} = this.context.site;
|
||||
this.plans = this.getPlansData({plans});
|
||||
const activePlan = this.getActivePlanName({member}) || this.plans[0].name;
|
||||
|
||||
let activePlan = this.getActivePlanName({member}) || this.plans[0].name;
|
||||
const activePlanExists = this.plans.some(d => d.name === activePlan);
|
||||
if (!activePlanExists) {
|
||||
activePlan = this.plans[0].name;
|
||||
}
|
||||
this.state = {
|
||||
plan: activePlan
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user