From 949162bcabd6fb39d9fe1302b35030bca10e28e8 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Thu, 28 Jan 2021 23:20:38 -0500 Subject: [PATCH] Fix fast account switching animating in wrong direction --- Tusker/MainSceneDelegate.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tusker/MainSceneDelegate.swift b/Tusker/MainSceneDelegate.swift index c4be6561..d03ee87c 100644 --- a/Tusker/MainSceneDelegate.swift +++ b/Tusker/MainSceneDelegate.swift @@ -142,7 +142,7 @@ class MainSceneDelegate: UIResponder, UIWindowSceneDelegate { } func activateAccount(_ account: LocalData.UserAccountInfo, animated: Bool) { - + let oldMostRecentAccount = LocalData.shared.mostRecentAccountID LocalData.shared.setMostRecentAccount(account) window!.windowScene!.session.mastodonController = MastodonController.getForAccount(account) @@ -150,7 +150,7 @@ class MainSceneDelegate: UIResponder, UIWindowSceneDelegate { if let container = window?.rootViewController as? AccountSwitchingContainerViewController { let direction: AccountSwitchingContainerViewController.AnimationDirection if animated, - let oldIndex = LocalData.shared.accounts.firstIndex(where: { $0.id == LocalData.shared.mostRecentAccountID }), + let oldIndex = LocalData.shared.accounts.firstIndex(where: { $0.id == oldMostRecentAccount }), let newIndex = LocalData.shared.accounts.firstIndex(of: account) { direction = newIndex > oldIndex ? .upwards : .downwards } else {