Skip to content

Commit

Permalink
Merge release/1.83.0 into main
Browse files Browse the repository at this point in the history
  • Loading branch information
daxmobile authored Apr 9, 2024
2 parents 532ec92 + faadae5 commit f7e2089
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Configuration/BuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 154
CURRENT_PROJECT_VERSION = 156
27 changes: 18 additions & 9 deletions DuckDuckGo/NavigationBar/View/NavigationBarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -309,16 +309,25 @@ final class NavigationBarViewController: NSViewController {
}
#endif

// 1. If the user is on the waitlist but hasn't been invited or accepted terms and conditions, show the waitlist screen.
// 2. If the user has no waitlist state but has an auth token, show the NetP popover.
// 3. If the user has no state of any kind, show the waitlist screen.

if NetworkProtectionWaitlist().shouldShowWaitlistViewController {
NetworkProtectionWaitlistViewControllerPresenter.show()
} else if NetworkProtectionKeychainTokenStore().isFeatureActivated {
popovers.toggleNetworkProtectionPopover(usingView: networkProtectionButton, withDelegate: networkProtectionButtonModel)
// Note: the following code is quite contrived but we're aiming to hotfix issues without mixing subscription and
// waitlist logic. This should be cleaned up once waitlist can safely be removed.

if DefaultSubscriptionFeatureAvailability().isFeatureAvailable {
if NetworkProtectionKeychainTokenStore().isFeatureActivated {
popovers.toggleNetworkProtectionPopover(usingView: networkProtectionButton, withDelegate: networkProtectionButtonModel)
}
} else {
NetworkProtectionWaitlistViewControllerPresenter.show()
// 1. If the user is on the waitlist but hasn't been invited or accepted terms and conditions, show the waitlist screen.
// 2. If the user has no waitlist state but has an auth token, show the NetP popover.
// 3. If the user has no state of any kind, show the waitlist screen.

if NetworkProtectionWaitlist().shouldShowWaitlistViewController {
NetworkProtectionWaitlistViewControllerPresenter.show()
} else if NetworkProtectionKeychainTokenStore().isFeatureActivated {
popovers.toggleNetworkProtectionPopover(usingView: networkProtectionButton, withDelegate: networkProtectionButtonModel)
} else {
NetworkProtectionWaitlistViewControllerPresenter.show()
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion DuckDuckGo/Waitlist/NetworkProtectionFeatureDisabler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ final class NetworkProtectionFeatureDisabler: NetworkProtectionFeatureDisabling
@MainActor
@discardableResult
func disable(keepAuthToken: Bool, uninstallSystemExtension: Bool) async -> Bool {
// We can do this optimistically as it has little if any impact.
unpinNetworkProtection()

// To disable NetP we need the login item to be running
// This should be fine though as we'll disable them further down below
guard canUninstall(includingSystemExtension: uninstallSystemExtension) else {
Expand All @@ -83,7 +86,6 @@ final class NetworkProtectionFeatureDisabler: NetworkProtectionFeatureDisabling
isDisabling = true

defer {
unpinNetworkProtection()
resetUserDefaults(uninstallSystemExtension: uninstallSystemExtension)
}

Expand Down

0 comments on commit f7e2089

Please sign in to comment.