Review fixes

pull/266/head
Mikunj 6 years ago
parent c7130a3bbb
commit b2ecb87462

@ -1825,6 +1825,11 @@
"Button action that the user can click to view their unique seed" "Button action that the user can click to view their unique seed"
}, },
"seedViewTitle": {
"message": "Please save the seed below in a safe location. They can be used to restore your account if you lose access or migrate to a new device.",
"description": "The title shown when the user views their seeds"
},
"copiedMnemonic": { "copiedMnemonic": {
"message": "Copied seed to clipboard", "message": "Copied seed to clipboard",
"description": "description":

@ -238,7 +238,7 @@
<!-- Password --> <!-- Password -->
<div class="passwordView"> <div class="passwordView">
<div class='title'> <div class='title'>
Please type in your password {{ passwordViewTitle }}
</div> </div>
<div class='fields'> <div class='fields'>
<input class='form-control' type='password' id='password' placeholder='Password' autocomplete='off' spellcheck='false'> <input class='form-control' type='password' id='password' placeholder='Password' autocomplete='off' spellcheck='false'>
@ -253,9 +253,7 @@
<!-- Seed --> <!-- Seed -->
<div class="seedView" style="display: none;"> <div class="seedView" style="display: none;">
<div class='title'> <div class='title'>
Please save the seed below in a safe location. {{ seedViewTitle }}
</br>
They can be used to restore your account if you lose access or migrate to a new device.
</div> </div>
<div class='seed'></div> <div class='seed'></div>
<div class='buttons'> <div class='buttons'>

@ -19,6 +19,8 @@
this.render(); this.render();
this.showSeedView(false); this.showSeedView(false);
this.initPasswordHash(); this.initPasswordHash();
this.$('#password').bind('keyup', (event) => this.onKeyup(event));
}, },
events: { events: {
'click .ok': 'close', 'click .ok': 'close',
@ -27,6 +29,8 @@
}, },
render_attributes() { render_attributes() {
return { return {
passwordViewTitle: i18n('passwordViewTitle'),
seedViewTitle: i18n('seedViewTitle'),
ok: this.okText, ok: this.okText,
copyText: this.copyText, copyText: this.copyText,
confirm: this.confirmText, confirm: this.confirmText,
@ -48,6 +52,7 @@
} else { } else {
this.$('.seed').html(''); this.$('.seed').html('');
passwordView.show(); passwordView.show();
this.$('#password').focus()
seedView.hide(); seedView.hide();
} }
}, },
@ -76,5 +81,18 @@
toast.$el.appendTo(this.$el); toast.$el.appendTo(this.$el);
toast.render(); toast.render();
}, },
onKeyup(event) {
switch (event.key) {
case 'Enter':
this.confirmPassword();
break;
case 'Escape':
case 'Esc':
this.close();
break;
default:
break;
}
},
}); });
})(); })();

Loading…
Cancel
Save