UI update should be invoked on the main thread
This commit is contained in:
parent
bb1c003228
commit
f71c4964f5
|
@ -17,6 +17,7 @@ final class RemoteProfileViewModel: ProfileViewModel {
|
|||
init(context: AppContext, authContext: AuthContext, userID: Mastodon.Entity.Account.ID) {
|
||||
super.init(context: context, authContext: authContext, optionalMastodonUser: nil)
|
||||
|
||||
Task { @MainActor in
|
||||
let domain = authContext.mastodonAuthenticationBox.domain
|
||||
let authorization = authContext.mastodonAuthenticationBox.userAuthorization
|
||||
Just(userID)
|
||||
|
@ -46,10 +47,13 @@ final class RemoteProfileViewModel: ProfileViewModel {
|
|||
assertionFailure()
|
||||
return
|
||||
}
|
||||
DispatchQueue.main.async {
|
||||
self.user = mastodonUser
|
||||
}
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
}
|
||||
}
|
||||
|
||||
init(context: AppContext, authContext: AuthContext, notificationID: Mastodon.Entity.Notification.ID) {
|
||||
super.init(context: context, authContext: authContext, optionalMastodonUser: nil)
|
||||
|
|
|
@ -73,11 +73,12 @@ extension ThreadViewModel.LoadThreadState {
|
|||
return
|
||||
}
|
||||
|
||||
Task {
|
||||
Task { @MainActor in
|
||||
do {
|
||||
let response = try await viewModel.context.apiService.statusContext(
|
||||
statusID: threadContext.statusID,
|
||||
authenticationBox: viewModel.authContext.mastodonAuthenticationBox
|
||||
authenticationBox: viewModel.authContext.mastodonAuthenticationBox,
|
||||
domain: threadContext.domain
|
||||
)
|
||||
|
||||
await enter(state: NoMore.self)
|
||||
|
|
Loading…
Reference in New Issue