diff --git a/lib/providers/generate_wallets.dart b/lib/providers/generate_wallets.dart index 47150f95e6cdf2bc4e591f52f5ec2035b1e593f2..9e4ec1018090429b8e497c5cc28d9c3c0ccbbc51 100644 --- a/lib/providers/generate_wallets.dart +++ b/lib/providers/generate_wallets.dart @@ -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('é', 'eÌ'); word = word.replaceAll('è', 'eÌ€'); - 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) {