mirror of
https://github.com/monero-project/monero-gui.git
synced 2026-04-02 02:57:26 -04:00
Filter out multiple blanks in seed input when counting words
This commit is contained in:
@@ -97,10 +97,6 @@ function tr(text) {
|
|||||||
return qsTr(text) + translationManager.emptyString
|
return qsTr(text) + translationManager.emptyString
|
||||||
}
|
}
|
||||||
|
|
||||||
function lineBreaksToSpaces(text) {
|
|
||||||
return text.trim().replace(/(\r\n|\n|\r)/gm, " ");
|
|
||||||
}
|
|
||||||
|
|
||||||
function usefulName(path) {
|
function usefulName(path) {
|
||||||
// arbitrary "short enough" limit
|
// arbitrary "short enough" limit
|
||||||
if (path.length < 32)
|
if (path.length < 32)
|
||||||
@@ -110,7 +106,7 @@ function usefulName(path) {
|
|||||||
|
|
||||||
function checkSeed(seed) {
|
function checkSeed(seed) {
|
||||||
console.log("Checking seed")
|
console.log("Checking seed")
|
||||||
var wordsArray = lineBreaksToSpaces(seed).split(" ");
|
var wordsArray = seed.split(/\s+/);
|
||||||
return wordsArray.length === 25 || wordsArray.length === 24
|
return wordsArray.length === 25 || wordsArray.length === 24
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user