Don't allow users to add Reddit or Twitter feeds if they don't have an extension configured.
This commit is contained in:
parent
9a91648acc
commit
d6ed015514
|
@ -420,13 +420,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
|||
return !isDisplayingSheet && !AccountManager.shared.activeAccounts.isEmpty
|
||||
}
|
||||
if item.action == #selector(showAddRedditFeedWindow(_:)) {
|
||||
guard !isDisplayingSheet && isSpecialAccountAvailable else {
|
||||
guard !isDisplayingSheet && isSpecialAccountAvailable && ExtensionPointManager.shared.isRedditEnabled else {
|
||||
return false
|
||||
}
|
||||
return ExtensionPointManager.shared.isRedditEnabled
|
||||
}
|
||||
if item.action == #selector(showAddTwitterFeedWindow(_:)) {
|
||||
guard !isDisplayingSheet && isSpecialAccountAvailable else {
|
||||
guard !isDisplayingSheet && isSpecialAccountAvailable && ExtensionPointManager.shared.isTwitterEnabled else {
|
||||
return false
|
||||
}
|
||||
return ExtensionPointManager.shared.isTwitterEnabled
|
||||
|
|
|
@ -27,7 +27,7 @@ class ExtensionPointAddViewController: NSViewController {
|
|||
super.viewDidLoad()
|
||||
tableView.dataSource = self
|
||||
tableView.delegate = self
|
||||
availableExtensionPointTypes = ExtensionPointManager.shared.availableExtensionPointTypes
|
||||
availableExtensionPointTypes = ExtensionPointManager.shared.availableExtensionPointTypes.sorted(by: { $0.title < $1.title })
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -423,9 +423,13 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
|
|||
alertController.addAction(addWebFeedAction)
|
||||
|
||||
if AccountManager.shared.activeAccounts.contains(where: { $0.type == .onMyMac || $0.type == .cloudKit }) {
|
||||
if ExtensionPointManager.shared.isRedditEnabled {
|
||||
alertController.addAction(addRedditFeedAction)
|
||||
}
|
||||
if ExtensionPointManager.shared.isTwitterEnabled {
|
||||
alertController.addAction(addTwitterFeedAction)
|
||||
}
|
||||
}
|
||||
|
||||
alertController.addAction(addWebFolderAction)
|
||||
alertController.addAction(cancelAction)
|
||||
|
|
|
@ -18,7 +18,7 @@ class AddExtensionPointViewController: UITableViewController, AddExtensionPointD
|
|||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
availableExtensionPointTypes = ExtensionPointManager.shared.availableExtensionPointTypes
|
||||
availableExtensionPointTypes = ExtensionPointManager.shared.availableExtensionPointTypes.sorted(by: { $0.title < $1.title })
|
||||
}
|
||||
|
||||
override func numberOfSections(in tableView: UITableView) -> Int {
|
||||
|
|
Loading…
Reference in New Issue