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
}
guard currentArticle != nil else {
let articleViewController = UIStoryboard.main.instantiateController(ofType: ArticleViewController.self)
articleViewController.coordinator = self
if let articleViewController = masterNavigationController.viewControllers.last as? ArticleViewController {
masterNavigationController.popViewController(animated: false)
let controller = addNavControllerIfNecessary(articleViewController, showButton: true)
return controller
}
if let articleViewController = masterNavigationController.viewControllers.last as? ArticleViewController {
masterNavigationController.popViewController(animated: false)
if currentArticle == nil {
let articleViewController = UIStoryboard.main.instantiateController(ofType: ArticleViewController.self)
articleViewController.coordinator = self
let controller = addNavControllerIfNecessary(articleViewController, showButton: true)
return controller
}