Disable the Add Twitter menu item if there are no active accounts

This commit is contained in:
Maurice Parker 2020-05-02 15:06:59 -05:00
parent 19b01679f0
commit 7420b607ce
1 changed files with 3 additions and 0 deletions

View File

@ -404,6 +404,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
return !isDisplayingSheet && !AccountManager.shared.activeAccounts.isEmpty
}
if item.action == #selector(showAddTwitterFeedWindow(_:)) {
guard !isDisplayingSheet && !AccountManager.shared.activeAccounts.isEmpty else {
return false
}
return ExtensionPointManager.shared.activeExtensionPoints.values.contains(where: { $0 is TwitterFeedProvider })
}
#if !MAC_APP_STORE