diff --git a/ui/pages/create-account/new-account.component.js b/ui/pages/create-account/new-account.component.js index 6111a9a4c..4b6e59ea2 100644 --- a/ui/pages/create-account/new-account.component.js +++ b/ui/pages/create-account/new-account.component.js @@ -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);