From 8371517c8d752d8f68c8de094d8d1843858b1861 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 22 Apr 2020 11:36:07 -0500 Subject: [PATCH] Disable Add Twitter Feed menu item if no Twitter extension points are available --- Mac/AppDelegate.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index e8bc956b3..80f68a1b9 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -403,6 +403,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, if item.action == #selector(showAddWebFeedWindow(_:)) || item.action == #selector(showAddFolderWindow(_:)) { return !isDisplayingSheet && !AccountManager.shared.activeAccounts.isEmpty } + if item.action == #selector(showAddTwitterFeedWindow(_:)) { + return ExtensionPointManager.shared.activeExtensionPoints.values.contains(where: { $0 is TwitterFeedProvider }) + } #if !MAC_APP_STORE if item.action == #selector(toggleWebInspectorEnabled(_:)) { (item as! NSMenuItem).state = AppDefaults.webInspectorEnabled ? .on : .off