Merge pull request #718 from h3poteto/696/fix
fixes #696 Check acct when parse account
This commit is contained in:
commit
08af4bc609
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue