From 2e4db2aa7285ce2581fd940be531dc2d4884c516 Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Sat, 17 Nov 2018 17:59:31 +0900
Subject: [PATCH] fixes #696 Check acct when parse account
---
.../TimelineSpace/Contents/SideBar/AccountProfile.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile.js b/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile.js
index cb7949d515..687d051557 100644
--- a/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile.js
+++ b/src/renderer/store/TimelineSpace/Contents/SideBar/AccountProfile.js
@@ -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) {