Skip to content

Commit

Permalink
fixes #696 Check acct when parse account
Browse files Browse the repository at this point in the history
  • Loading branch information
h3poteto committed Nov 17, 2018
1 parent e4cea39 commit 2e4db2a
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ const AccountProfile = {
return client.get('/search', { q: parsedAccount.acct, resolve: true })
.then(res => {
if (res.data.accounts.length <= 0) throw new AccountNotFound('empty result')
const account = res.data.accounts.find(a => `@${a.username}` === parsedAccount.username)
if (!account) throw new AccountNotFound('not found')
return account
const account = res.data.accounts.find(a => `@${a.acct}` === parsedAccount.acct)
if (account) return account
const user = res.data.accounts.find(a => `@${a.username}@${rootState.TimelineSpace.account.domain}` === parsedAccount.acct)
if (!user) throw new AccountNotFound('not found')
return user
})
},
changeAccount ({ commit, dispatch }, account) {
Expand Down

0 comments on commit 2e4db2a

Please sign in to comment.