From 4f3f56bda5df3670a6cd2176c0542f4a5ba4a3bb Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 1 Dec 2019 13:45:18 -0600 Subject: [PATCH] Correct scenario where article view controller wasn't getting popped of the navigation stack when there wasn't a selected article. --- iOS/SceneCoordinator.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 668ee99c0..7c58a4d84 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -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 }