From 425d100989f6150e514cf9715e023f027a25bd74 Mon Sep 17 00:00:00 2001 From: jinsu kim Date: Fri, 30 Dec 2022 00:43:19 -0800 Subject: [PATCH] Fix bug - scrollToTop() should be called when user selects the current tab --- Mastodon/Scene/Root/MainTab/MainTabBarController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mastodon/Scene/Root/MainTab/MainTabBarController.swift b/Mastodon/Scene/Root/MainTab/MainTabBarController.swift index b0af9b6d6..27a9cdf90 100644 --- a/Mastodon/Scene/Root/MainTab/MainTabBarController.swift +++ b/Mastodon/Scene/Root/MainTab/MainTabBarController.swift @@ -572,7 +572,7 @@ extension MainTabBarController: UITabBarControllerDelegate { // Assert index is as same as the tab rawValue. This check needs to be done `shouldSelect` // because the nav controller has already popped in `didSelect`. - if currentTab.rawValue == tabBarController.selectedIndex, + if currentTab.rawValue == viewController.tabBarItem.tag, let navigationController = viewController as? UINavigationController, navigationController.viewControllers.count == 1, let scrollViewContainer = navigationController.topViewController as? ScrollViewContainer {