Update import.js

This commit is contained in:
Marcos Rodriguez Vélez 2021-11-14 10:57:48 -05:00
parent 3b182774be
commit c2138f20c3
No known key found for this signature in database
GPG key ID: 0D64671698D11C5C

View file

@ -55,6 +55,7 @@ const WalletsImport = () => {
const onBlur = () => {
const valueWithSingleWhitespace = importText.replace(/^\s+|\s+$|\s+(?=\s)/g, '');
setImportText(valueWithSingleWhitespace);
return valueWithSingleWhitespace;
};
useEffect(() => {
@ -75,10 +76,11 @@ const WalletsImport = () => {
}, []);
const importButtonPressed = () => {
if (importText.trim().length === 0) {
const textToImport = onBlur();
if (textToImport.trim().length === 0) {
return;
}
importMnemonic(importText);
importMnemonic(textToImport);
};
const importMnemonic = importText => {