Fix user profile not loaded from status on home timeline (IOS-176)
This commit is contained in:
parent
e6ba8db5b6
commit
837d8dd329
|
@ -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
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue