(heroOriginal)
| 93 | } |
| 94 | |
| 95 | saveHeroSelection (heroOriginal) { |
| 96 | if (!me.get('heroConfig')) { me.set({ heroConfig: {} }) } |
| 97 | const heroConfig = _.assign({}, me.get('heroConfig'), { thangType: heroOriginal }) |
| 98 | me.set({ heroConfig }) |
| 99 | |
| 100 | const hero = _.find(this.heroes, { original: heroOriginal }) |
| 101 | return me.save().then(() => { |
| 102 | if (utils.isCodeCmbat && this.destroyed) { return } |
| 103 | let event = 'Hero selected' |
| 104 | event += me.isStudent() ? ' student' : ' teacher' |
| 105 | if (this.options.createAccount) { event += ' create account' } |
| 106 | const category = me.isStudent() ? 'Students' : 'Teachers' |
| 107 | window.tracker?.trackEvent(event, { category, heroOriginal }) |
| 108 | return this.trigger('hero-select:success', { attributes: hero }) |
| 109 | }) |
| 110 | } |
| 111 | } |
| 112 | HeroSelectView.initClass() |
| 113 | return HeroSelectView |
no test coverage detected