Disable Twitter Extension Point for Developer Build.

This commit is contained in:
Maurice Parker 2020-04-22 14:16:50 -05:00
parent 7b37f51f59
commit 0ac5a6dbca
5 changed files with 11 additions and 5 deletions

View File

@ -16,6 +16,7 @@ import RSCore
protocol ExtensionPoint { protocol ExtensionPoint {
static var isSinglton: Bool { get } static var isSinglton: Bool { get }
static var isDeveloperBuildRestricted: Bool { get }
static var title: String { get } static var title: String { get }
static var templateImage: RSImage { get } static var templateImage: RSImage { get }
static var description: NSAttributedString { get } static var description: NSAttributedString { get }

View File

@ -26,12 +26,14 @@ final class ExtensionPointManager: FeedProviderManagerDelegate {
let activeExtensionPointTypes = activeExtensionPoints.keys.compactMap({ ObjectIdentifier($0.extensionPointType) }) let activeExtensionPointTypes = activeExtensionPoints.keys.compactMap({ ObjectIdentifier($0.extensionPointType) })
var available = [ExtensionPoint.Type]() var available = [ExtensionPoint.Type]()
for possibleExtensionPointType in possibleExtensionPointTypes { for possibleExtensionPointType in possibleExtensionPointTypes {
if possibleExtensionPointType.isSinglton { if !(AppDefaults.isDeveloperBuild && possibleExtensionPointType.isDeveloperBuildRestricted) {
if !activeExtensionPointTypes.contains(ObjectIdentifier(possibleExtensionPointType)) { if possibleExtensionPointType.isSinglton {
if !activeExtensionPointTypes.contains(ObjectIdentifier(possibleExtensionPointType)) {
available.append(possibleExtensionPointType)
}
} else {
available.append(possibleExtensionPointType) available.append(possibleExtensionPointType)
} }
} else {
available.append(possibleExtensionPointType)
} }
} }

View File

@ -13,6 +13,7 @@ import Articles
final class SendToMarsEditCommand: ExtensionPoint, SendToCommand { final class SendToMarsEditCommand: ExtensionPoint, SendToCommand {
static var isSinglton = true static var isSinglton = true
static var isDeveloperBuildRestricted = false
static var title = NSLocalizedString("MarsEdit", comment: "MarsEdit") static var title = NSLocalizedString("MarsEdit", comment: "MarsEdit")
static var templateImage = AppAssets.extensionPointMarsEdit static var templateImage = AppAssets.extensionPointMarsEdit
static var description: NSAttributedString = { static var description: NSAttributedString = {

View File

@ -14,7 +14,8 @@ import RSCore
final class SendToMicroBlogCommand: ExtensionPoint, SendToCommand { final class SendToMicroBlogCommand: ExtensionPoint, SendToCommand {
static var isSinglton: Bool = true static var isSinglton = true
static var isDeveloperBuildRestricted = false
static var title: String = NSLocalizedString("Micro.blog", comment: "Micro.blog") static var title: String = NSLocalizedString("Micro.blog", comment: "Micro.blog")
static var templateImage = AppAssets.extensionPointMicroblog static var templateImage = AppAssets.extensionPointMicroblog
static var description: NSAttributedString = { static var description: NSAttributedString = {

View File

@ -12,6 +12,7 @@ import Account
extension TwitterFeedProvider: ExtensionPoint { extension TwitterFeedProvider: ExtensionPoint {
static var isSinglton = false static var isSinglton = false
static var isDeveloperBuildRestricted = true
static var title = NSLocalizedString("Twitter", comment: "Twitter") static var title = NSLocalizedString("Twitter", comment: "Twitter")
static var templateImage = AppAssets.extensionPointTwitter static var templateImage = AppAssets.extensionPointTwitter
static var description: NSAttributedString = { static var description: NSAttributedString = {