Correct scenario where article view controller wasn't getting popped of the navigation stack when there wasn't a selected article.

This commit is contained in:
Maurice Parker 2019-12-01 13:45:18 -06:00
parent 33c487de85
commit 4f3f56bda5
1 changed files with 5 additions and 5 deletions

View File

@ -1102,15 +1102,15 @@ extension SceneCoordinator: UISplitViewControllerDelegate {
return subSplitViewController return subSplitViewController
} }
guard currentArticle != nil else { if let articleViewController = masterNavigationController.viewControllers.last as? ArticleViewController {
let articleViewController = UIStoryboard.main.instantiateController(ofType: ArticleViewController.self) masterNavigationController.popViewController(animated: false)
articleViewController.coordinator = self
let controller = addNavControllerIfNecessary(articleViewController, showButton: true) let controller = addNavControllerIfNecessary(articleViewController, showButton: true)
return controller return controller
} }
if let articleViewController = masterNavigationController.viewControllers.last as? ArticleViewController { if currentArticle == nil {
masterNavigationController.popViewController(animated: false) let articleViewController = UIStoryboard.main.instantiateController(ofType: ArticleViewController.self)
articleViewController.coordinator = self
let controller = addNavControllerIfNecessary(articleViewController, showButton: true) let controller = addNavControllerIfNecessary(articleViewController, showButton: true)
return controller return controller
} }