MCPcopy Index your code
hub / github.com/codecombat/codecombat / onLoaded

Method onLoaded

app/views/core/SubscribeModal.js:87–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85 }
86
87 onLoaded () {
88 this.basicProduct = this.products.getBasicSubscriptionForUser(me)
89 this.basicProductAnnual = this.products.getBasicAnnualSubscriptionForUser()
90 // Process basic product coupons unless custom region pricing
91 if (this.couponID && ((this.basicProduct != null ? this.basicProduct.get('coupons') : undefined) != null) && ((this.basicProduct != null ? this.basicProduct.get('name') : undefined) === 'basic_subscription')) {
92 this.basicCoupon = _.find(this.basicProduct.get('coupons'), { code: this.couponID })
93 }
94 if (this.couponID && ((this.basicProductAnnual != null ? this.basicProductAnnual.get('coupons') : undefined) != null) && ((this.basicProductAnnual != null ? this.basicProductAnnual.get('name') : undefined) === 'basic_subscription_annual')) {
95 this.basicCouponAnnual = _.find(this.basicProductAnnual.get('coupons'), { code: this.couponID })
96 }
97 this.lifetimeProduct = this.products.getLifetimeSubscriptionForUser(me)
98 this.paymentProcessor = 'stripe' // Always use Stripe
99 this.isParentHomeAccount = me.isParentHome()
100 super.onLoaded()
101 return this.render()
102 }
103
104 render () {
105 if (this.state === 'purchasing') { return }

Callers 1

constructorMethod · 0.95

Calls 6

renderMethod · 0.95
isParentHomeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected