mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +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 accountNameExists = (allAccounts, accountName) => {
|
||||||
const accountsNames = allAccounts.map((item) => item.name);
|
return Boolean(allAccounts.find((item) => item.name === accountName));
|
||||||
|
|
||||||
return accountsNames.includes(accountName);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const existingAccountName = accountNameExists(accounts, newAccountName);
|
const existingAccountName = accountNameExists(accounts, newAccountName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user