Validate sort-by menu items.

This commit is contained in:
Brent Simmons 2018-01-27 15:13:45 -08:00
parent 7e0917cb4e
commit 8968d00d6d
1 changed files with 3 additions and 0 deletions

View File

@ -248,6 +248,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
if item.action == #selector(addAppNews(_:)) {
return !AccountManager.shared.anyAccountHasFeedWithURL(appNewsURLString)
}
if item.action == #selector(sortByNewestArticleOnTop(_:)) || item.action == #selector(sortByOldestArticleOnTop(_:)) {
return mainWindowController?.isOpen ?? false
}
return true
}