Disable refresh and add NNW app news when there are no active accounts.

This commit is contained in:
Maurice Parker 2019-05-19 14:23:54 -05:00
parent a40842d928
commit 10c5ca4e1a

View File

@ -273,10 +273,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
let isDisplayingSheet = mainWindowController?.isDisplayingSheet ?? false
if item.action == #selector(refreshAll(_:)) {
return !AccountManager.shared.refreshInProgress
return !AccountManager.shared.refreshInProgress && !AccountManager.shared.activeAccounts.isEmpty
}
if item.action == #selector(addAppNews(_:)) {
return !isDisplayingSheet && !AccountManager.shared.anyAccountHasFeedWithURL(appNewsURLString)
return !isDisplayingSheet && !AccountManager.shared.anyAccountHasFeedWithURL(appNewsURLString) && !AccountManager.shared.activeAccounts.isEmpty
}
if item.action == #selector(sortByNewestArticleOnTop(_:)) || item.action == #selector(sortByOldestArticleOnTop(_:)) {
return mainWindowController?.isOpen ?? false