fix a rare bug when opening accounts

This commit is contained in:
Nicolas Constant 2019-04-03 00:08:50 -04:00
parent 3e54134c30
commit ba49d0cf6a
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 3 additions and 3 deletions

View File

@ -44,10 +44,10 @@ export class ToolsService {
.then((result: Results) => {
if(accountName[0] === '@') accountName = accountName.substr(1);
const foundAccount = result.accounts.filter(
const foundAccount = result.accounts.find(
x => x.acct.toLowerCase() === accountName.toLowerCase()
|| x.acct.toLowerCase() === accountName.toLowerCase().split('@')[0]
)[0];
|| x.acct.toLowerCase().split('@')[0] === accountName.toLowerCase().split('@')[0]
);
return foundAccount;
});
}