Optimize account name check (#15985)

feature/default_network_editable
David Walsh 2 years ago committed by GitHub
parent d9dda82678
commit 2a5922d774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ui/pages/create-account/new-account.component.js

@ -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…
Cancel
Save