Skip to content

Commit

Permalink
Remove crashy stuff from subsfeatureavailaibility
Browse files Browse the repository at this point in the history
  • Loading branch information
graeme committed Mar 14, 2024
1 parent 0f19b47 commit 944ddce
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions DuckDuckGo/Subscription/SubscriptionFeatureAvailability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ struct DefaultSubscriptionFeatureAvailability: SubscriptionFeatureAvailability {
#if SUBSCRIPTION_OVERRIDE_ENABLED
return true
#elseif SUBSCRIPTION
print("isUserAuthenticated: [\(AccountManager().isUserAuthenticated)] | isSubscriptionInternalTestingEnabled: [\(isSubscriptionInternalTestingEnabled)] isInternalUser: [\(isInternalUser)] | isVPNActivated: [\(isVPNActivated)] | isDBPActivated: [\(isDBPActivated)]")
return AccountManager().isUserAuthenticated || (isSubscriptionInternalTestingEnabled && isInternalUser && !isVPNActivated && !isDBPActivated)
print("isUserAuthenticated: [\(AccountManager().isUserAuthenticated)] | isSubscriptionInternalTestingEnabled: [\(isSubscriptionInternalTestingEnabled)] isInternalUser: [\(isInternalUser)] | isDBPActivated: [\(isDBPActivated)]")
return AccountManager().isUserAuthenticated || (isSubscriptionInternalTestingEnabled && isInternalUser && !isDBPActivated)
#else
return false
#endif
Expand All @@ -51,14 +51,6 @@ struct DefaultSubscriptionFeatureAvailability: SubscriptionFeatureAvailability {
NSApp.delegateTyped.internalUserDecider.isInternalUser
}

private var isVPNActivated: Bool {
#if NETWORK_PROTECTION
return NetworkProtectionKeychainTokenStore().isFeatureActivated
#else
return false
#endif
}

private var isDBPActivated: Bool {
#if DBP
return DataBrokerProtectionManager.shared.dataManager.fetchProfile(ignoresCache: true) != nil
Expand Down

0 comments on commit 944ddce

Please sign in to comment.