Make sure mark as read completes before searching for the next unread. Fixes #2952
This commit is contained in:
parent
92fd016b7a
commit
3955151daf
|
@ -843,7 +843,7 @@ private extension AppDelegate {
|
|||
os_log(.debug, "No article found from search using %@", articleID)
|
||||
return
|
||||
}
|
||||
account!.markArticles(article!, statusKey: .read, flag: true)
|
||||
account!.markArticles(article!, statusKey: .read, flag: true) { _ in }
|
||||
}
|
||||
|
||||
func handleMarkAsStarred(userInfo: [AnyHashable: Any]) {
|
||||
|
@ -862,6 +862,6 @@ private extension AppDelegate {
|
|||
os_log(.debug, "No article found from search using %@", articleID)
|
||||
return
|
||||
}
|
||||
account!.markArticles(article!, statusKey: .starred, flag: true)
|
||||
account!.markArticles(article!, statusKey: .starred, flag: true) { _ in }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -397,8 +397,9 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
|
|||
}
|
||||
|
||||
@IBAction func markAllAsReadAndGoToNextUnread(_ sender: Any?) {
|
||||
markAllAsRead(sender)
|
||||
nextUnread(sender)
|
||||
currentTimelineViewController?.markAllAsRead() {
|
||||
self.nextUnread(sender)
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func markUnreadAndGoToNextUnread(_ sender: Any?) {
|
||||
|
|
|
@ -233,8 +233,8 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
|
|||
|
||||
// MARK: - API
|
||||
|
||||
func markAllAsRead() {
|
||||
guard let undoManager = undoManager, let markReadCommand = MarkStatusCommand(initialArticles: articles, markingRead: true, undoManager: undoManager) else {
|
||||
func markAllAsRead(completion: (() -> Void)? = nil) {
|
||||
guard let undoManager = undoManager, let markReadCommand = MarkStatusCommand(initialArticles: articles, markingRead: true, undoManager: undoManager, completion: completion) else {
|
||||
return
|
||||
}
|
||||
runCommand(markReadCommand)
|
||||
|
|
|
@ -41,12 +41,12 @@ final class MarkStatusCommand: UndoableCommand {
|
|||
self.redoActionName = actionName
|
||||
}
|
||||
|
||||
convenience init?(initialArticles: [Article], markingRead: Bool, undoManager: UndoManager) {
|
||||
self.init(initialArticles: initialArticles, statusKey: .read, flag: markingRead, undoManager: undoManager)
|
||||
convenience init?(initialArticles: [Article], markingRead: Bool, undoManager: UndoManager, completion: (() -> Void)? = nil) {
|
||||
self.init(initialArticles: initialArticles, statusKey: .read, flag: markingRead, undoManager: undoManager, completion: completion)
|
||||
}
|
||||
|
||||
convenience init?(initialArticles: [Article], markingStarred: Bool, undoManager: UndoManager) {
|
||||
self.init(initialArticles: initialArticles, statusKey: .starred, flag: markingStarred, undoManager: undoManager)
|
||||
convenience init?(initialArticles: [Article], markingStarred: Bool, undoManager: UndoManager, completion: (() -> Void)? = nil) {
|
||||
self.init(initialArticles: initialArticles, statusKey: .starred, flag: markingStarred, undoManager: undoManager, completion: completion)
|
||||
}
|
||||
|
||||
func perform() {
|
||||
|
|
Loading…
Reference in New Issue