fix: add domain when querying for user on GoToSocial (#2221)
parent
895c1ecd8d
commit
a6e4da8c41
|
@ -69,10 +69,10 @@ export async function fetchAccountByHandle(acct: string): Promise<mastodon.v1.Ac
|
||||||
async function lookupAccount() {
|
async function lookupAccount() {
|
||||||
const client = useMastoClient()
|
const client = useMastoClient()
|
||||||
let account: mastodon.v1.Account
|
let account: mastodon.v1.Account
|
||||||
if (!isGotoSocial.value)
|
if (!isGotoSocial.value) // TODO: GoToSocial will support this endpoint from 0.10.0
|
||||||
account = await client.v1.accounts.lookup({ acct: userAcct })
|
account = await client.v1.accounts.lookup({ acct: userAcct })
|
||||||
else
|
else
|
||||||
account = (await client.v1.search({ q: `@${userAcct}`, type: 'accounts' })).accounts[0]
|
account = (await client.v1.search({ q: `@${userAcct}@${domain}`, type: 'accounts' })).accounts[0]
|
||||||
|
|
||||||
if (account.acct && !account.acct.includes('@') && domain)
|
if (account.acct && !account.acct.includes('@') && domain)
|
||||||
account.acct = `${account.acct}@${domain}`
|
account.acct = `${account.acct}@${domain}`
|
||||||
|
|
Loading…
Reference in New Issue