mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
Optimize account name check (#15985)
This commit is contained in:
parent
d9dda82678
commit
2a5922d774
@ -47,9 +47,7 @@ export default class NewAccountCreateForm extends Component {
|
||||
};
|
||||
|
||||
const accountNameExists = (allAccounts, accountName) => {
|
||||
const accountsNames = allAccounts.map((item) => item.name);
|
||||
|
||||
return accountsNames.includes(accountName);
|
||||
return Boolean(allAccounts.find((item) => item.name === accountName));
|
||||
};
|
||||
|
||||
const existingAccountName = accountNameExists(accounts, newAccountName);
|
||||
|
Loading…
Reference in New Issue
Block a user