Put hack in to select next unread item. WIP

This commit is contained in:
Maurice Parker 2020-07-19 15:50:01 -05:00
parent 68a569ec0b
commit fe2b81b47b
2 changed files with 10 additions and 1 deletions

View File

@ -56,8 +56,8 @@ final class SceneModel: ObservableObject {
/// Goes to the next unread item found in Sidebar and Timeline order, top to bottom /// Goes to the next unread item found in Sidebar and Timeline order, top to bottom
func goToNextUnread() { func goToNextUnread() {
if !timelineModel.goToNextUnread() { if !timelineModel.goToNextUnread() {
timelineModel.isSelectNextUnread = true
sidebarModel.goToNextUnread() sidebarModel.goToNextUnread()
timelineModel.goToNextUnread()
} }
} }

View File

@ -44,6 +44,9 @@ class TimelineModel: ObservableObject, UndoableCommandRunner {
} }
} }
// I don't like this flag and feel like it is a hack. Maybe there is a better way to do this using Combine.
var isSelectNextUnread = false
var undoManager: UndoManager? var undoManager: UndoManager?
var undoableCommands = [UndoableCommand]() var undoableCommands = [UndoableCommand]()
@ -510,6 +513,12 @@ private extension TimelineModel {
selectedArticleIDs = Set<String>() selectedArticleIDs = Set<String>()
selectedArticleID = nil selectedArticleID = nil
if isSelectNextUnread {
goToNextUnread()
isSelectNextUnread = false
}
// TODO: Update unread counts and other item done in didSet on AppKit // TODO: Update unread counts and other item done in didSet on AppKit
} }