Skip to content
Snippets Groups Projects
Commit 3f75fa5c authored by poka's avatar poka
Browse files

fix: do not valid mnemonic word if others exist in import

parent d7fcf063
No related branches found
No related tags found
Loading
Pipeline #15961 failed
......@@ -273,12 +273,25 @@ class GenerateWalletsProvider with ChangeNotifier {
}
bool isBipWord(String word) {
bool isValid = false;
notifyListeners();
// Needed for bad encoding of UTF-8
word = word.replaceAll('é', 'é');
word = word.replaceAll('è', 'è');
return bip39Words(appLang).contains(word.toLowerCase());
int nbrMatch = 0;
if (bip39Words(appLang).contains(word.toLowerCase())) {
for (var bipWord in bip39Words(appLang)) {
if (bipWord.startsWith(word)) {
log.d('ploppp : ' + nbrMatch.toString());
isValid = nbrMatch == 0 ? true : false;
nbrMatch = nbrMatch + 1;
}
}
}
return isValid;
}
bool isBipWordsList(List<String> words) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment