prevent using same wallet name as existing (#391)

* Add wallet name validation
This commit is contained in:
Serhii
2022-06-29 18:21:21 +01:00
committed by GitHub
parent dc623f3293
commit 02533d68a0
25 changed files with 137 additions and 51 deletions
+6
View File
@@ -32,6 +32,12 @@ abstract class WalletCreationVMBase with Store {
final Box<WalletInfo> _walletInfoSource;
final AppStore _appStore;
bool nameExists(String name) {
final walletNameList = _walletInfoSource.values.map((e) => e.name.toLowerCase()).toList();
return walletNameList.contains(name.toLowerCase());
}
Future<void> create({dynamic options}) async {
try {
state = IsExecutingState();