From abbe042c8af0fd2840a9078eeeea47fe7334182d Mon Sep 17 00:00:00 2001 From: rbrunner7 Date: Mon, 11 May 2020 15:27:07 +0200 Subject: [PATCH] Filter out multiple blanks in seed input when counting words --- js/Wizard.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/js/Wizard.js b/js/Wizard.js index a3d892cb..054b13f7 100644 --- a/js/Wizard.js +++ b/js/Wizard.js @@ -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 }