diff --git a/Tusker/Scenes/MainSceneDelegate.swift b/Tusker/Scenes/MainSceneDelegate.swift index fd88a82851..b83de24c07 100644 --- a/Tusker/Scenes/MainSceneDelegate.swift +++ b/Tusker/Scenes/MainSceneDelegate.swift @@ -247,6 +247,9 @@ class MainSceneDelegate: UIResponder, UIWindowSceneDelegate, TuskerSceneDelegate LogoutService(accountInfo: account).run() if UserAccountsManager.shared.onboardingComplete { activateAccount(UserAccountsManager.shared.accounts.first!, animated: false) + if let container = window?.rootViewController as? AccountSwitchingContainerViewController { + container.removeAccount(account) + } } else { window!.rootViewController = createOnboardingUI() } diff --git a/Tusker/Screens/Main/AccountSwitchingContainerViewController.swift b/Tusker/Screens/Main/AccountSwitchingContainerViewController.swift index 4c467981f4..4eb58e6873 100644 --- a/Tusker/Screens/Main/AccountSwitchingContainerViewController.swift +++ b/Tusker/Screens/Main/AccountSwitchingContainerViewController.swift @@ -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) { let oldRoot = self.root if direction == .none {