Disable navigation for selectPrevUnread and selectNextUnread

This commit is contained in:
Maurice Parker
2022-11-11 20:26:48 -06:00
committed by Brent Simmons
parent fa6269fa1f
commit c7b606c89e
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

@@ -118,6 +118,8 @@ class SceneCoordinator: NSObject, UndoableCommandRunner {
return activity
}
var isNavigationDisabled = false
var isRootSplitCollapsed: Bool {
return rootSplitViewController.isCollapsed
}
@@ -922,6 +924,11 @@ class SceneCoordinator: NSObject, UndoableCommandRunner {
return
}
isNavigationDisabled = true
defer {
isNavigationDisabled = false
}
if selectPrevUnreadArticleInTimeline() {
return
}
@@ -938,6 +945,11 @@ class SceneCoordinator: NSObject, UndoableCommandRunner {
return
}
isNavigationDisabled = true
defer {
isNavigationDisabled = false
}
if selectNextUnreadArticleInTimeline() {
return
}
@@ -949,7 +961,6 @@ class SceneCoordinator: NSObject, UndoableCommandRunner {
selectNextUnreadFeed() {
self.selectNextUnreadArticleInTimeline()
}
}
func scrollOrGoToNextUnread() {