Merge branch 'mac-release' into main

This commit is contained in:
Maurice Parker 2021-04-15 14:31:52 -05:00
commit 77dd2e5e22
3 changed files with 9 additions and 8 deletions

View File

@ -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?) {

View File

@ -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)

View File

@ -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() {