Fixed the problem that the header information on the profile screen was not displayed (#1187)

* Fixed the problem that the header information on the profile screen was not displayed

* Fixed parallelism issue

---------

Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
This commit is contained in:
Yusuke Arakawa 2023-03-08 02:24:20 +09:00 committed by GitHub
parent 156279faac
commit 9d1e077762
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -132,9 +132,15 @@ class AccountDetailViewModel: ObservableObject, StatusesFetcher {
async let featuredTags: [FeaturedTag] = client.get(endpoint: Accounts.featuredTags(id: accountId))
if client.isAuth && !isCurrentUser {
async let relationships: [Relationship] = client.get(endpoint: Accounts.relationships(ids: [accountId]))
return try await .init(account: account,
featuredTags: featuredTags,
relationships: relationships)
do {
return try await .init(account: account,
featuredTags: featuredTags,
relationships: relationships)
} catch {
return try await .init(account: account,
featuredTags: [],
relationships: relationships)
}
}
return try await .init(account: account,
featuredTags: featuredTags,