Disable navigation for selectPrevUnread and selectNextUnread

This commit is contained in:
Maurice Parker
2022-11-11 20:26:48 -06:00
parent 2ec176eedc
commit d45f6cd3a7
2 changed files with 17 additions and 1 deletions

View File

@@ -25,6 +25,11 @@ class RootSplitViewController: UISplitViewController {
coordinator.resetFocus()
}
override func show(_ column: UISplitViewController.Column) {
guard !coordinator.isNavigationDisabled else { return }
super.show(column)
}
// MARK: Keyboard Shortcuts
@objc func scrollOrGoToNextUnread(_ sender: Any?) {

View File

@@ -127,6 +127,8 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, Logging {
return activity
}
var isNavigationDisabled = false
var isRootSplitCollapsed: Bool {
return rootSplitViewController.isCollapsed
}
@@ -932,6 +934,11 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, Logging {
return
}
isNavigationDisabled = true
defer {
isNavigationDisabled = false
}
if selectPrevUnreadArticleInTimeline() {
return
}
@@ -948,6 +955,11 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, Logging {
return
}
isNavigationDisabled = true
defer {
isNavigationDisabled = false
}
if selectNextUnreadArticleInTimeline() {
return
}
@@ -959,7 +971,6 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, Logging {
selectNextUnreadFeed() {
self.selectNextUnreadArticleInTimeline()
}
}
func scrollOrGoToNextUnread() {