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