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

Method constructor

app/views/core/RecoverModal.js:51–68  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

49 }
50
51 constructor (options) {
52 super(options)
53 this.successfullyRecovered = this.successfullyRecovered.bind(this)
54 this.recoverAccountHandler = filterKeyboardEvents([13], (e) => {
55 this.playSound('menu-button-click')
56 forms.clearFormAlerts(this.$el)
57 const {
58 email
59 } = forms.formToObject(this.$el)
60 if (!email) { return }
61 if (!utils.isValidEmail(email)) {
62 return noty({ text: $.i18n.t('form_validation_errors.invalidEmail'), layout: 'center', type: 'error', timeout: 3000 })
63 }
64 const res = $.post('/auth/reset', { email }, this.successfullyRecovered)
65 res.fail(genericFailure)
66 return this.enableModalInProgress(this.$el)
67 }) // TODO: part of forms
68 }
69
70 recoverAccount (e) {
71 return this.recoverAccountHandler(e)

Callers

nothing calls this directly

Calls 2

filterKeyboardEventsFunction · 0.85
failMethod · 0.80

Tested by

no test coverage detected