mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-25 05:58:42 +01:00
prevent using same wallet name as existing (#391)
* Add wallet name validation
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user