From ddf8b045556034ee91105af309a4f3016b268bd6 Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Thu, 14 Mar 2024 16:49:54 +0100 Subject: [PATCH] Removing some waitlist code (#2406) Task/Issue URL: https://app.asana.com/0/0/1206800069675135/f ## Description Removing some of our waitlist code so that nothing screams "new" for the VPN. --- .../NavigationBar/View/MoreOptionsMenu.swift | 28 ++----------------- .../NetworkProtectionNavBarButtonModel.swift | 21 -------------- 2 files changed, 3 insertions(+), 46 deletions(-) diff --git a/DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift b/DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift index 24ecc77e86..6ff8bfea32 100644 --- a/DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift +++ b/DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift @@ -339,18 +339,9 @@ final class MoreOptionsMenu: NSMenu { #if NETWORK_PROTECTION if networkProtectionFeatureVisibility.isNetworkProtectionVisible() { - let isWaitlistUser = NetworkProtectionWaitlist().waitlistStorage.isWaitlistUser - let hasAuthToken = NetworkProtectionKeychainTokenStore().isFeatureActivated - let networkProtectionItem: NSMenuItem - // If the user can see the VPN option but they haven't joined the waitlist or don't have an auth token, show the "New" - // badge to bring it to their attention. - if !isWaitlistUser && !hasAuthToken { - networkProtectionItem = makeNetworkProtectionItem(showNewLabel: true) - } else { - networkProtectionItem = makeNetworkProtectionItem(showNewLabel: false) - } + networkProtectionItem = makeNetworkProtectionItem() items.append(networkProtectionItem) @@ -490,25 +481,12 @@ final class MoreOptionsMenu: NSMenu { } #if NETWORK_PROTECTION - private func makeNetworkProtectionItem(showNewLabel: Bool) -> NSMenuItem { + private func makeNetworkProtectionItem() -> NSMenuItem { let networkProtectionItem = NSMenuItem(title: "", action: #selector(showNetworkProtectionStatus(_:)), keyEquivalent: "") .targetting(self) .withImage(.image(for: .vpnIcon)) - if showNewLabel { - let attributedText = NSMutableAttributedString(string: UserText.networkProtection) - attributedText.append(NSAttributedString(string: " ")) - - let imageAttachment = NSTextAttachment() - imageAttachment.image = .newLabel - imageAttachment.setImageHeight(height: 16, offset: .init(x: 0, y: -4)) - - attributedText.append(NSAttributedString(attachment: imageAttachment)) - - networkProtectionItem.attributedTitle = attributedText - } else { - networkProtectionItem.title = UserText.networkProtection - } + networkProtectionItem.title = UserText.networkProtection return networkProtectionItem } diff --git a/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionNavBarButtonModel.swift b/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionNavBarButtonModel.swift index c756d18ac6..057f5b622c 100644 --- a/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionNavBarButtonModel.swift +++ b/DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionNavBarButtonModel.swift @@ -113,13 +113,6 @@ final class NetworkProtectionNavBarButtonModel: NSObject, ObservableObject { guard [.normal, .integrationTests].contains(NSApp.runType) else { return NSImage() } #endif - let isWaitlistUser = NetworkProtectionWaitlist().waitlistStorage.isWaitlistUser - let hasAuthToken = NetworkProtectionKeychainTokenStore().isFeatureActivated - - if !isWaitlistUser && !hasAuthToken { - return .networkProtectionAvailableButton - } - if NetworkProtectionWaitlist().readyToAcceptTermsAndConditions { return .networkProtectionAvailableButton } @@ -191,20 +184,6 @@ final class NetworkProtectionNavBarButtonModel: NSObject, ObservableObject { showButton = true return } - - let waitlist = NetworkProtectionWaitlist() - let isWaitlistUser = waitlist.waitlistStorage.isWaitlistUser - let hasAuthToken = NetworkProtectionKeychainTokenStore().isFeatureActivated - -#if !APPSTORE - // If the user hasn't signed up to the waitlist or doesn't have an auth token through some other method, then show them the badged icon - // to get their attention and encourage them to sign up. Also avoid showing the button is the user has opened the waitlist UI but - // dismissed it. - if !isWaitlistUser && !hasAuthToken && !waitlist.waitlistSignUpPromptDismissed { - showButton = true - return - } -#endif } guard !isPinned,