MCPcopy Create free account
hub / github.com/codecombat/codecombat / constructor

Method constructor

app/views/play/modal/BuyGemsModal.js:42–61  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

40 }
41
42 constructor (options) {
43 super(options)
44 this.timestampForPurchase = new Date().getTime()
45 this.state = 'standby'
46 this.products = new Products()
47 this.products.comparator = 'amount'
48 if (application.isIPadApp) {
49 this.products = []
50 Backbone.Mediator.publish('buy-gems-modal:update-products')
51 } else {
52 this.supermodel.loadCollection(this.products, 'products')
53 $.post('/db/payment/check-stripe-charges', (something, somethingElse, jqxhr) => {
54 if (jqxhr.status === 201) {
55 this.state = 'recovered_charge'
56 return this.render()
57 }
58 })
59 }
60 this.trackTimeVisible({ trackViewLifecycle: true })
61 }
62
63 onLoaded () {
64 this.basicProduct = this.products.getBasicSubscriptionForUser(me)

Callers

nothing calls this directly

Calls 2

publishMethod · 0.80
renderMethod · 0.45

Tested by

no test coverage detected