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)
|
os_log(.debug, "No article found from search using %@", articleID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
account!.markArticles(article!, statusKey: .read, flag: true)
|
account!.markArticles(article!, statusKey: .read, flag: true) { _ in }
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleMarkAsStarred(userInfo: [AnyHashable: Any]) {
|
func handleMarkAsStarred(userInfo: [AnyHashable: Any]) {
|
||||||
|
@ -862,6 +862,6 @@ private extension AppDelegate {
|
||||||
os_log(.debug, "No article found from search using %@", articleID)
|
os_log(.debug, "No article found from search using %@", articleID)
|
||||||
return
|
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?) {
|
@IBAction func markAllAsReadAndGoToNextUnread(_ sender: Any?) {
|
||||||
markAllAsRead(sender)
|
currentTimelineViewController?.markAllAsRead() {
|
||||||
nextUnread(sender)
|
self.nextUnread(sender)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@IBAction func markUnreadAndGoToNextUnread(_ sender: Any?) {
|
@IBAction func markUnreadAndGoToNextUnread(_ sender: Any?) {
|
||||||
|
|
|
@ -233,8 +233,8 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
|
||||||
|
|
||||||
// MARK: - API
|
// MARK: - API
|
||||||
|
|
||||||
func markAllAsRead() {
|
func markAllAsRead(completion: (() -> Void)? = nil) {
|
||||||
guard let undoManager = undoManager, let markReadCommand = MarkStatusCommand(initialArticles: articles, markingRead: true, undoManager: undoManager) else {
|
guard let undoManager = undoManager, let markReadCommand = MarkStatusCommand(initialArticles: articles, markingRead: true, undoManager: undoManager, completion: completion) else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
runCommand(markReadCommand)
|
runCommand(markReadCommand)
|
||||||
|
|
|
@ -41,12 +41,12 @@ final class MarkStatusCommand: UndoableCommand {
|
||||||
self.redoActionName = actionName
|
self.redoActionName = actionName
|
||||||
}
|
}
|
||||||
|
|
||||||
convenience init?(initialArticles: [Article], markingRead: Bool, undoManager: UndoManager) {
|
convenience init?(initialArticles: [Article], markingRead: Bool, undoManager: UndoManager, completion: (() -> Void)? = nil) {
|
||||||
self.init(initialArticles: initialArticles, statusKey: .read, flag: markingRead, undoManager: undoManager)
|
self.init(initialArticles: initialArticles, statusKey: .read, flag: markingRead, undoManager: undoManager, completion: completion)
|
||||||
}
|
}
|
||||||
|
|
||||||
convenience init?(initialArticles: [Article], markingStarred: Bool, undoManager: UndoManager) {
|
convenience init?(initialArticles: [Article], markingStarred: Bool, undoManager: UndoManager, completion: (() -> Void)? = nil) {
|
||||||
self.init(initialArticles: initialArticles, statusKey: .starred, flag: markingStarred, undoManager: undoManager)
|
self.init(initialArticles: initialArticles, statusKey: .starred, flag: markingStarred, undoManager: undoManager, completion: completion)
|
||||||
}
|
}
|
||||||
|
|
||||||
func perform() {
|
func perform() {
|
||||||
|
|
Loading…
Reference in New Issue