Skip to content

Commit

Permalink
Release PR: Update NetP invite code copy (#2237)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1199230911884351/1206658960345551/f
Tech Design URL:
CC:

Description:

This PR fixes three issues with the VPN waitlist.

1. The "beta" copy has been removed from the invite code UI
2. The invite code easter egg now properly resets the waitlist state when you use it, to avoid the app getting confused
3. The "VPN Settings" option now only appears in the NetP popover when onboarding is complete, as that is the same condition used in the settings UI
  • Loading branch information
samsymons authored Feb 21, 2024
1 parent 394378e commit 5f13100
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 16 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 = 121
CURRENT_PROJECT_VERSION = 124
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extension UserText {

// MARK: - Invite Code

static let networkProtectionInviteDialogTitle = NSLocalizedString("network.protection.invite.dialog.title", value: "You've unlocked a beta feature!", comment: "Title for the network protection invite dialog")
static let networkProtectionInviteDialogTitle = NSLocalizedString("network.protection.invite.dialog.title", value: "Enter your invite code", comment: "Title for the network protection invite dialog")
static let networkProtectionInviteDialogMessage = NSLocalizedString("network.protection.invite.dialog.message", value: "Enter your invite code to get started.", comment: "Message for the network protection invite dialog")
static let networkProtectionInviteFieldPrompt = NSLocalizedString("network.protection.invite.field.prompt", value: "Code", comment: "Prompt for the network protection invite code text field")
static let networkProtectionInviteSuccessTitle = NSLocalizedString("network.protection.invite.success.title", value: "Success! You’re in.", comment: "Title for the network protection invite success view")
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -5590,7 +5590,7 @@
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "You've unlocked a beta feature!"
"value" : "Enter your invite code"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ final class NetworkProtectionInviteCodeViewModel: InviteCodeViewModel {
showProgressView = true
do {
try await redemptionCoordinator.redeem(textFieldText.trimmingWhitespace())

// If the user bypassed the waitlist, then erase any existing waitlist state they already have to avoid confusing the app.
NetworkProtectionWaitlist().waitlistStorage.deleteWaitlistState()
UserDefaults().removeObject(forKey: UserDefaultsWrapper<Bool>.Key.networkProtectionTermsAndConditionsAccepted.rawValue)
UserDefaults().removeObject(forKey: UserDefaultsWrapper<Bool>.Key.networkProtectionWaitlistSignUpPromptDismissed.rawValue)
NotificationCenter.default.post(name: .networkProtectionWaitlistAccessChanged, object: nil)
} catch NetworkProtectionClientError.invalidInviteCode {
errorText = UserText.inviteDialogUnrecognizedCodeMessage
showProgressView = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,27 @@ final class NetworkProtectionNavBarPopoverManager {
statusReporter: statusReporter,
appLauncher: appLauncher,
menuItems: {
let menuItems = [
NetworkProtectionStatusView.Model.MenuItem(
name: UserText.networkProtectionNavBarStatusMenuVPNSettings, action: {
await appLauncher.launchApp(withCommand: .showSettings)
}),
NetworkProtectionStatusView.Model.MenuItem(
name: UserText.networkProtectionNavBarStatusViewShareFeedback,
action: {
await appLauncher.launchApp(withCommand: .shareFeedback)
})
]

return menuItems
if UserDefaults.netP.networkProtectionOnboardingStatus == .completed {
return [
NetworkProtectionStatusView.Model.MenuItem(
name: UserText.networkProtectionNavBarStatusMenuVPNSettings, action: {
await appLauncher.launchApp(withCommand: .showSettings)
}),
NetworkProtectionStatusView.Model.MenuItem(
name: UserText.networkProtectionNavBarStatusViewShareFeedback,
action: {
await appLauncher.launchApp(withCommand: .shareFeedback)
})
]
} else {
return [
NetworkProtectionStatusView.Model.MenuItem(
name: UserText.networkProtectionNavBarStatusViewShareFeedback,
action: {
await appLauncher.launchApp(withCommand: .shareFeedback)
})
]
}
},
agentLoginItem: LoginItem.vpnMenu
)
Expand Down

0 comments on commit 5f13100

Please sign in to comment.