When logging out, remove the scene's active account rather than the most-recently activated one, as they may not be the same

This commit is contained in:
Shadowfacts 2023-01-02 11:41:40 -05:00
parent b45d3fb80a
commit acd48a6db4
1 changed files with 4 additions and 1 deletions

View File

@ -211,7 +211,10 @@ class MainSceneDelegate: UIResponder, UIWindowSceneDelegate, TuskerSceneDelegate
} }
func logoutCurrent() { func logoutCurrent() {
LocalData.shared.removeAccount(LocalData.shared.getMostRecentAccount()!) guard let account = window?.windowScene?.session.mastodonController?.accountInfo else {
return
}
LocalData.shared.removeAccount(account)
if LocalData.shared.onboardingComplete { if LocalData.shared.onboardingComplete {
activateAccount(LocalData.shared.accounts.first!, animated: false) activateAccount(LocalData.shared.accounts.first!, animated: false)
} else { } else {