diff --git a/Tusker/Screens/Main/MainSplitViewController.swift b/Tusker/Screens/Main/MainSplitViewController.swift index 004620b397..f356cc93e0 100644 --- a/Tusker/Screens/Main/MainSplitViewController.swift +++ b/Tusker/Screens/Main/MainSplitViewController.swift @@ -180,26 +180,41 @@ class MainSplitViewController: UISplitViewController { } @objc func handleSidebarCommandTimelines() { + if let previous = sidebar.selectedItem { + navigationStacks[previous] = secondaryNavController.viewControllers + } sidebar.select(item: .tab(.timelines), animated: false) select(item: .tab(.timelines)) } @objc func handleSidebarCommandNotifications() { + if let previous = sidebar.selectedItem { + navigationStacks[previous] = secondaryNavController.viewControllers + } sidebar.select(item: .tab(.notifications), animated: false) select(item: .tab(.notifications)) } @objc func handleSidebarCommandExplore() { + if let previous = sidebar.selectedItem { + navigationStacks[previous] = secondaryNavController.viewControllers + } sidebar.select(item: .tab(.explore), animated: false) select(item: .tab(.explore)) } @objc func handleSidebarCommandBookmarks() { + if let previous = sidebar.selectedItem { + navigationStacks[previous] = secondaryNavController.viewControllers + } sidebar.select(item: .bookmarks, animated: false) select(item: .bookmarks) } @objc func handleSidebarCommandMyProfile() { + if let previous = sidebar.selectedItem { + navigationStacks[previous] = secondaryNavController.viewControllers + } sidebar.select(item: .tab(.myProfile), animated: false) select(item: .tab(.myProfile)) }