Add hidden GruberFeedDoubleClickMarkAsRead preference

This commit is contained in:
Maurice Parker 2021-02-26 17:38:26 -06:00
parent 8a9a9910cc
commit 74298e7cde
2 changed files with 15 additions and 0 deletions

View File

@ -44,6 +44,7 @@ final class AppDefaults {
static let timelineShowsSeparators = "CorreiaSeparators"
static let showTitleOnMainWindow = "KafasisTitleMode"
static let hideDockUnreadCount = "JustinMillerHideDockUnreadCount"
static let feedDoubleClickMarkAsRead = "GruberFeedDoubleClickMarkAsRead"
#if !MAC_APP_STORE
static let webInspectorEnabled = "WebInspectorEnabled"
@ -203,6 +204,15 @@ final class AppDefaults {
}
}
var feedDoubleClickMarkAsRead: Bool {
get {
return AppDefaults.bool(for: Key.feedDoubleClickMarkAsRead)
}
set {
AppDefaults.setBool(for: Key.feedDoubleClickMarkAsRead, newValue)
}
}
#if !MAC_APP_STORE
var webInspectorEnabled: Bool {
get {

View File

@ -255,6 +255,11 @@ protocol SidebarDelegate: class {
guard outlineView.clickedRow == outlineView.selectedRow else {
return
}
if AppDefaults.shared.feedDoubleClickMarkAsRead, let articles = try? singleSelectedWebFeed?.fetchUnreadArticles() {
if let undoManager = undoManager, let markReadCommand = MarkStatusCommand(initialArticles: Array(articles), markingRead: true, undoManager: undoManager) {
runCommand(markReadCommand)
}
}
openInBrowser(sender)
}