1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Fix remote prop not appended in all places

This commit is contained in:
xmflsct
2023-01-29 16:59:14 +01:00
parent 8c87841fed
commit e447a91cfb
6 changed files with 40 additions and 76 deletions

View File

@ -1,6 +1,7 @@
import { QueryFunctionContext, useQuery, UseQueryOptions } from '@tanstack/react-query'
import apiGeneral from '@utils/api/general'
import apiInstance from '@utils/api/instance'
import { appendRemote } from '@utils/helpers/appendRemote'
import { urlMatcher } from '@utils/helpers/urlMatcher'
import { AxiosError } from 'axios'
import { searchLocalAccount } from './search'
@ -34,14 +35,14 @@ const accountQueryFunction = async ({ queryKey }: QueryFunctionContext<QueryKeyA
method: 'get',
domain: domain,
url: `api/v1/accounts/${id}`
}).then(res => ({ ...res.body, _remote: true }))
}).then(res => appendRemote.account(res.body))
} else if (acct) {
matchedAccount = await apiGeneral<Mastodon.Account>({
method: 'get',
domain: domain,
url: 'api/v1/accounts/lookup',
params: { acct }
}).then(res => ({ ...res.body, _remote: true }))
}).then(res => appendRemote.account(res.body))
}
} catch {}
}