forked from shadowfacts/Tusker
Fix creating list on iPad not showing Edit List screen immediately
This commit is contained in:
parent
b515664db3
commit
e005b70071
|
@ -48,7 +48,7 @@ class ListTimelineViewController: TimelineViewController {
|
||||||
super.viewDidAppear(animated)
|
super.viewDidAppear(animated)
|
||||||
|
|
||||||
if presentEditOnAppear {
|
if presentEditOnAppear {
|
||||||
presentEdit(animated: animated)
|
presentEdit(animated: true)
|
||||||
presentEditOnAppear = false
|
presentEditOnAppear = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import Combine
|
||||||
protocol MainSidebarViewControllerDelegate: AnyObject {
|
protocol MainSidebarViewControllerDelegate: AnyObject {
|
||||||
func sidebarRequestPresentCompose(_ sidebarViewController: MainSidebarViewController)
|
func sidebarRequestPresentCompose(_ sidebarViewController: MainSidebarViewController)
|
||||||
func sidebar(_ sidebarViewController: MainSidebarViewController, didSelectItem item: MainSidebarViewController.Item)
|
func sidebar(_ sidebarViewController: MainSidebarViewController, didSelectItem item: MainSidebarViewController.Item)
|
||||||
|
func sidebar(_ sidebarViewController: MainSidebarViewController, showViewController viewController: UIViewController)
|
||||||
}
|
}
|
||||||
|
|
||||||
class MainSidebarViewController: UIViewController {
|
class MainSidebarViewController: UIViewController {
|
||||||
|
@ -281,7 +282,10 @@ class MainSidebarViewController: UIViewController {
|
||||||
private func showAddList() {
|
private func showAddList() {
|
||||||
let service = CreateListService(mastodonController: mastodonController, present: { self.present($0, animated: true
|
let service = CreateListService(mastodonController: mastodonController, present: { self.present($0, animated: true
|
||||||
) }) { list in
|
) }) { list in
|
||||||
self.sidebarDelegate?.sidebar(self, didSelectItem: .list(list))
|
self.select(item: .list(list), animated: false)
|
||||||
|
let list = ListTimelineViewController(for: list, mastodonController: self.mastodonController)
|
||||||
|
list.presentEditOnAppear = true
|
||||||
|
self.sidebarDelegate?.sidebar(self, showViewController: list)
|
||||||
}
|
}
|
||||||
service.run()
|
service.run()
|
||||||
}
|
}
|
||||||
|
|
|
@ -358,6 +358,13 @@ extension MainSplitViewController: MainSidebarViewControllerDelegate {
|
||||||
}
|
}
|
||||||
select(item: item)
|
select(item: item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func sidebar(_ sidebarViewController: MainSidebarViewController, showViewController viewController: UIViewController) {
|
||||||
|
if let previous = sidebar.previouslySelectedItem {
|
||||||
|
navigationStacks[previous] = secondaryNavController.viewControllers
|
||||||
|
}
|
||||||
|
secondaryNavController.viewControllers = [viewController]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate extension MainSidebarViewController.Item {
|
fileprivate extension MainSidebarViewController.Item {
|
||||||
|
|
Loading…
Reference in New Issue