Fix user profile not loaded from status on home timeline (IOS-176)

This commit is contained in:
Marcus Kida 2023-12-01 10:14:12 +01:00
parent e6ba8db5b6
commit 837d8dd329
No known key found for this signature in database
GPG Key ID: 19FF64E08013CA40
1 changed files with 17 additions and 6 deletions

View File

@ -17,18 +17,29 @@ extension DataSourceFacade {
target: StatusTarget, target: StatusTarget,
status: MastodonStatus status: MastodonStatus
) async { ) async {
let _redirectRecord = await DataSourceFacade.author( let acct: String = {
managedObjectContext: provider.context.managedObjectContext, switch target {
status: status, case .status:
target: target return status.reblog?.entity.account.acct ?? status.entity.account.acct
) case .reblog:
return status.entity.account.acct
}
}()
let _redirectRecord = try? await Mastodon.API.Account.lookupAccount(
session: .shared,
domain: provider.authContext.mastodonAuthenticationBox.domain,
query: .init(acct: acct),
authorization: provider.authContext.mastodonAuthenticationBox.userAuthorization
).singleOutput().value
guard let redirectRecord = _redirectRecord else { guard let redirectRecord = _redirectRecord else {
assertionFailure() assertionFailure()
return return
} }
await coordinateToProfileScene( await coordinateToProfileScene(
provider: provider, provider: provider,
user: redirectRecord account: redirectRecord
) )
} }