diff --git a/background.html b/background.html
index a62c7dd4c..f0a891ea0 100644
--- a/background.html
+++ b/background.html
@@ -579,6 +579,7 @@
+
Language:
@@ -586,7 +587,6 @@
Restore
-
Register a new account
diff --git a/js/views/standalone_registration_view.js b/js/views/standalone_registration_view.js
index 54d5706a4..9de088e5f 100644
--- a/js/views/standalone_registration_view.js
+++ b/js/views/standalone_registration_view.js
@@ -90,7 +90,7 @@
async register(mnemonic, language) {
// Make sure the password is valid
if (this.validatePassword()) {
- this.showToast('Invalid password');
+ this.showToast(i18n('invalidPassword'));
return;
}
@@ -119,6 +119,16 @@
registerWithMnemonic() {
const mnemonic = this.$('#mnemonic').val();
const language = this.$('#mnemonic-language').val();
+ try {
+ window.mnemonic.mn_decode(mnemonic, language);
+ } catch (error) {
+ this.$('#mnemonic').addClass('error-input');
+ this.$('#error').text(error);
+ this.$('#error').show();
+ return;
+ }
+ this.$('#error').hide();
+ this.$('#mnemonic').removeClass('error-input');
if (!mnemonic) {
this.log('Please provide a mnemonic word list');
} else {
@@ -148,11 +158,7 @@
onCopyMnemonic() {
window.clipboard.writeText(this.$('#mnemonic-display').text());
- const toast = new Whisper.MessageToastView({
- message: i18n('copiedMnemonic'),
- });
- toast.$el.appendTo(this.$el);
- toast.render();
+ this.showToast(i18n('copiedMnemonic'));
},
log(s) {
window.log.info(s);
diff --git a/libloki/modules/mnemonic.js b/libloki/modules/mnemonic.js
index aeb793f8e..81f223f45 100644
--- a/libloki/modules/mnemonic.js
+++ b/libloki/modules/mnemonic.js
@@ -141,7 +141,7 @@ function mn_decode(str, wordset_name) {
checksum_word.slice(0, wordset.prefix_len)
) {
throw new MnemonicError(
- 'Your private key could not be verified, please try again'
+ 'Your private key could not be verified, please verify the checksum word'
);
}
}
diff --git a/stylesheets/_global.scss b/stylesheets/_global.scss
index a928ad882..5a036488c 100644
--- a/stylesheets/_global.scss
+++ b/stylesheets/_global.scss
@@ -806,7 +806,8 @@ $loading-height: 16px;
}
}
- .password-inputs {
+ .password-inputs,
+ .standalone-mnemonic-inputs {
display: flex;
flex-direction: column;
justify-content: center;