FIX: If only one plan, automatically select it

This commit is contained in:
Justin DiRose 2020-07-28 11:08:21 -05:00
parent 9e66588038
commit 11d9b2e011
No known key found for this signature in database
GPG Key ID: 4B811FB264021800
1 changed files with 8 additions and 2 deletions

View File

@ -1,9 +1,15 @@
import Component from "@ember/component"; import Component from "@ember/component";
export default Component.extend({ export default Component.extend({
init() {
this._super(...arguments);
if (this.plans.length === 1) {
this.set("selectedPlan", this.plans[0].id);
}
},
actions: { actions: {
clickPlan(plan) { clickPlan(plan) {
this.set("selectedPlan", plan.id); this.set("selectedPlan", plan.id);
} },
} },
}); });