1
mirror of https://github.com/monero-project/monero-gui synced 2024-12-24 02:23:45 +01:00

Filter out multiple blanks in seed input when counting words

This commit is contained in:
rbrunner7 2020-05-11 15:27:07 +02:00
parent afe1ae9b9c
commit abbe042c8a

View File

@ -97,10 +97,6 @@ function tr(text) {
return qsTr(text) + translationManager.emptyString
}
function lineBreaksToSpaces(text) {
return text.trim().replace(/(\r\n|\n|\r)/gm, " ");
}
function usefulName(path) {
// arbitrary "short enough" limit
if (path.length < 32)
@ -110,7 +106,7 @@ function usefulName(path) {
function checkSeed(seed) {
console.log("Checking seed")
var wordsArray = lineBreaksToSpaces(seed).split(" ");
var wordsArray = seed.split(/\s+/);
return wordsArray.length === 25 || wordsArray.length === 24
}