diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 12b8d27c5..62361afd7 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -807,24 +807,24 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider { } } - func selectTodayFeed() { + func selectTodayFeed(completion: (() -> Void)? = nil) { markExpanded(SmartFeedsController.shared) self.ensureFeedIsAvailableToSelect(SmartFeedsController.shared.todayFeed) { - self.selectFeed(SmartFeedsController.shared.todayFeed, animations: [.navigation, .scroll]) + self.selectFeed(SmartFeedsController.shared.todayFeed, animations: [.navigation, .scroll], completion: completion) } } - func selectAllUnreadFeed() { + func selectAllUnreadFeed(completion: (() -> Void)? = nil) { markExpanded(SmartFeedsController.shared) self.ensureFeedIsAvailableToSelect(SmartFeedsController.shared.unreadFeed) { - self.selectFeed(SmartFeedsController.shared.unreadFeed, animations: [.navigation, .scroll]) + self.selectFeed(SmartFeedsController.shared.unreadFeed, animations: [.navigation, .scroll], completion: completion) } } - func selectStarredFeed() { + func selectStarredFeed(completion: (() -> Void)? = nil) { markExpanded(SmartFeedsController.shared) self.ensureFeedIsAvailableToSelect(SmartFeedsController.shared.starredFeed) { - self.selectFeed(SmartFeedsController.shared.starredFeed, animations: [.navigation, .scroll]) + self.selectFeed(SmartFeedsController.shared.starredFeed, animations: [.navigation, .scroll], completion: completion) } } diff --git a/iOS/SceneDelegate.swift b/iOS/SceneDelegate.swift index 9e7d988e6..9039eec7c 100644 --- a/iOS/SceneDelegate.swift +++ b/iOS/SceneDelegate.swift @@ -111,9 +111,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { if AccountManager.shared.isSuspended { AccountManager.shared.resumeAll() } - self.coordinator.selectFeed(SmartFeedsController.shared.unreadFeed, completion: { + self.coordinator.selectAllUnreadFeed() { self.coordinator.selectArticleInCurrentFeed(id!) - }) + } } else { self.coordinator.selectAllUnreadFeed() } @@ -127,9 +127,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { if AccountManager.shared.isSuspended { AccountManager.shared.resumeAll() } - self.coordinator.selectFeed(SmartFeedsController.shared.todayFeed, completion: { + self.coordinator.selectTodayFeed() { self.coordinator.selectArticleInCurrentFeed(id!) - }) + } } else { self.coordinator.selectTodayFeed() } @@ -143,9 +143,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { if AccountManager.shared.isSuspended { AccountManager.shared.resumeAll() } - self.coordinator.selectFeed(SmartFeedsController.shared.starredFeed, completion: { + self.coordinator.selectStarredFeed() { self.coordinator.selectArticleInCurrentFeed(id!) - }) + } } else { self.coordinator.selectStarredFeed() }