Remove old account UI state when logging out
This commit is contained in:
parent
5620b6ab78
commit
2c56902389
|
@ -247,6 +247,9 @@ class MainSceneDelegate: UIResponder, UIWindowSceneDelegate, TuskerSceneDelegate
|
||||||
LogoutService(accountInfo: account).run()
|
LogoutService(accountInfo: account).run()
|
||||||
if UserAccountsManager.shared.onboardingComplete {
|
if UserAccountsManager.shared.onboardingComplete {
|
||||||
activateAccount(UserAccountsManager.shared.accounts.first!, animated: false)
|
activateAccount(UserAccountsManager.shared.accounts.first!, animated: false)
|
||||||
|
if let container = window?.rootViewController as? AccountSwitchingContainerViewController {
|
||||||
|
container.removeAccount(account)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
window!.rootViewController = createOnboardingUI()
|
window!.rootViewController = createOnboardingUI()
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,10 @@ class AccountSwitchingContainerViewController: UIViewController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func removeAccount(_ account: UserAccountInfo) {
|
||||||
|
viewControllers.removeValue(forKey: account.id)
|
||||||
|
}
|
||||||
|
|
||||||
func setRoot(_ newRootProvider: () -> AccountSwitchableViewController, for account: UserAccountInfo, animating direction: AnimationDirection) {
|
func setRoot(_ newRootProvider: () -> AccountSwitchableViewController, for account: UserAccountInfo, animating direction: AnimationDirection) {
|
||||||
let oldRoot = self.root
|
let oldRoot = self.root
|
||||||
if direction == .none {
|
if direction == .none {
|
||||||
|
|
Loading…
Reference in New Issue