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 {
static var isSinglton: Bool { get }
static var isDeveloperBuildRestricted: Bool { get }
static var title: String { get }
static var templateImage: RSImage { get }
static var description: NSAttributedString { get }

View File

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

View File

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

View File

@ -14,7 +14,8 @@ import RSCore
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 templateImage = AppAssets.extensionPointMicroblog
static var description: NSAttributedString = {

View File

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