Merge pull request #586 from mastodon/chore-move-updateActiveUserAccountPublisher
Move updateActiveUserAccountPublisher to AuthenticationService
This commit is contained in:
commit
38afbbfbc8
|
@ -553,7 +553,7 @@ extension ProfileViewController {
|
|||
}
|
||||
|
||||
// trigger authenticated user account update
|
||||
viewModel.context.instanceService.updateActiveUserAccountPublisher.send()
|
||||
viewModel.context.authenticationService.updateActiveUserAccountPublisher.send()
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
||||
sender.endRefreshing()
|
||||
|
|
|
@ -313,7 +313,7 @@ extension MainTabBarController {
|
|||
let currentUserDisplayName = user.displayNameWithFallback ?? "no user"
|
||||
profileTabItem.accessibilityHint = L10n.Scene.AccountList.tabBarHint(currentUserDisplayName)
|
||||
|
||||
context.instanceService.updateActiveUserAccountPublisher
|
||||
context.authenticationService.updateActiveUserAccountPublisher
|
||||
.sink { [weak self] in
|
||||
self?.updateUserAccount()
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
|||
AppContext.shared.statusFilterService.filterUpdatePublisher.send()
|
||||
|
||||
// trigger authenticated user account update
|
||||
AppContext.shared.instanceService.updateActiveUserAccountPublisher.send()
|
||||
AppContext.shared.authenticationService.updateActiveUserAccountPublisher.send()
|
||||
|
||||
if let shortcutItem = savedShortCutItem {
|
||||
Task {
|
||||
|
|
|
@ -25,6 +25,7 @@ public final class AuthenticationService: NSObject {
|
|||
// output
|
||||
@Published public var mastodonAuthentications: [ManagedObjectRecord<MastodonAuthentication>] = []
|
||||
@Published public var mastodonAuthenticationBoxes: [MastodonAuthenticationBox] = []
|
||||
public let updateActiveUserAccountPublisher = PassthroughSubject<Void, Never>()
|
||||
|
||||
init(
|
||||
managedObjectContext: NSManagedObjectContext,
|
||||
|
|
|
@ -24,7 +24,6 @@ public final class InstanceService {
|
|||
weak var authenticationService: AuthenticationService?
|
||||
|
||||
// output
|
||||
public let updateActiveUserAccountPublisher = PassthroughSubject<Void, Never>()
|
||||
|
||||
init(
|
||||
apiService: APIService,
|
||||
|
|
Loading…
Reference in New Issue