Skip to content

Commit

Permalink
Merge branch 'hotfix/1.82.1' into release/1.83.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Apr 9, 2024
2 parents b9fa114 + fb1e132 commit d12e503
Show file tree
Hide file tree
Showing 3 changed files with 23 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 = 155
28 changes: 19 additions & 9 deletions DuckDuckGo/NavigationBar/View/NavigationBarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -309,16 +309,26 @@ 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()
DailyPixel.fire(pixel: .networkProtectionWaitlistIntroDisplayed, frequency: .dailyAndCount)

Check failure on line 326 in DuckDuckGo/NavigationBar/View/NavigationBarViewController.swift

View workflow job for this annotation

GitHub Actions / Make Release Build (DuckDuckGo Privacy Pro)

type 'Pixel.Event' has no member 'networkProtectionWaitlistIntroDisplayed'

Check failure on line 326 in DuckDuckGo/NavigationBar/View/NavigationBarViewController.swift

View workflow job for this annotation

GitHub Actions / Make Release Build (DuckDuckGo Privacy Browser)

type 'Pixel.Event' has no member 'networkProtectionWaitlistIntroDisplayed'

Check failure on line 326 in DuckDuckGo/NavigationBar/View/NavigationBarViewController.swift

View workflow job for this annotation

GitHub Actions / Make Release Build (DuckDuckGo Privacy Browser)

type 'Pixel.Event' has no member 'networkProtectionWaitlistIntroDisplayed'

Check failure on line 326 in DuckDuckGo/NavigationBar/View/NavigationBarViewController.swift

View workflow job for this annotation

GitHub Actions / Test (Non-Sandbox)

type 'Pixel.Event' has no member 'networkProtectionWaitlistIntroDisplayed'

Check failure on line 326 in DuckDuckGo/NavigationBar/View/NavigationBarViewController.swift

View workflow job for this annotation

GitHub Actions / Run Tests / Test (Non-Sandbox)

type 'Pixel.Event' has no member 'networkProtectionWaitlistIntroDisplayed'
} 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 d12e503

Please sign in to comment.