diff options
author | thaissiqueira <thais.siqueira@thoughtworks.com> | 2017-03-31 18:00:43 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-31 18:00:43 -0300 |
commit | f40808a147d1135e8bbee6d78306a598cf5ca647 (patch) | |
tree | 58d15414134ef5554e947348179e92e248df433b /web-ui/src/backup_account/backup_email/backup_email.js | |
parent | dadf39c1574d53612410371b8b639a159841eaf5 (diff) | |
parent | 304215fe36666c8401bd9fa01a50cab61ddc10ca (diff) |
Merge pull request #1040 from pixelated/email-recovery-code
[#927] Implements sending recovery code by email.
Diffstat (limited to 'web-ui/src/backup_account/backup_email/backup_email.js')
-rw-r--r-- | web-ui/src/backup_account/backup_email/backup_email.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/web-ui/src/backup_account/backup_email/backup_email.js b/web-ui/src/backup_account/backup_email/backup_email.js index 9d622d8d..8fa71191 100644 --- a/web-ui/src/backup_account/backup_email/backup_email.js +++ b/web-ui/src/backup_account/backup_email/backup_email.js @@ -31,7 +31,7 @@ export class BackupEmail extends React.Component { constructor(props) { super(props); - this.state = { error: '', submitButtonDisabled: true }; + this.state = { error: '', submitButtonDisabled: true, backupEmail: '' }; } validateEmail = (event) => { @@ -54,7 +54,8 @@ export class BackupEmail extends React.Component { 'Content-Type': 'application/json' }, body: JSON.stringify({ - csrftoken: [browser.getCookie('XSRF-TOKEN')] + csrftoken: [browser.getCookie('XSRF-TOKEN')], + backupEmail: this.state.backupEmail }) }).then((response) => { if (response.ok) { @@ -65,6 +66,11 @@ export class BackupEmail extends React.Component { }); }; + handleChange = (event) => { + this.setState({ backupEmail: event.target.value }); + this.validateEmail(event); + } + render() { const t = this.props.t; return ( @@ -78,7 +84,7 @@ export class BackupEmail extends React.Component { <h1>{t('backup-account.backup-email.title')}</h1> <p>{t('backup-account.backup-email.paragraph1')}</p> <p>{t('backup-account.backup-email.paragraph2')}</p> - <InputField name='email' label={t('backup-account.backup-email.input-label')} errorText={this.state.error} onChange={this.validateEmail} /> + <InputField name='email' value={this.state.backupEmail} label={t('backup-account.backup-email.input-label')} errorText={this.state.error} onChange={this.handleChange} /> <SubmitButton buttonText={t('backup-account.backup-email.button')} disabled={this.state.submitButtonDisabled} /> <BackLink href='/' |