Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only show DBP for US users #1792

Merged
merged 2 commits into from
Oct 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,22 @@ final class MoreOptionsMenu: NSMenu {
#endif // NETWORK_PROTECTION

#if DBP
let dataBrokerProtectionItem = NSMenuItem(title: UserText.dataBrokerProtectionOptionsMenuItem,
action: #selector(openDataBrokerProtection),
keyEquivalent: "")
.targetting(self)
.withImage(NSImage(named: "BurnerWindowIcon2")) // PLACEHOLDER: Change it once we have the final icon
items.append(dataBrokerProtectionItem)
var regionCode: String?
if #available(macOS 13, *) {
regionCode = Locale.current.region?.identifier
} else {
regionCode = Locale.current.regionCode
}

// Only show Private Information Removal (DBP) for US based users
if (regionCode ?? "US") == "US" {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a chance (using both methods to acquire the locale) that a user's region code could be nil. In this case I've elected to show the feature as we've discussed the risk of non-US users accessing the feature is minimal. I'm open to other suggestions though.

let dataBrokerProtectionItem = NSMenuItem(title: UserText.dataBrokerProtectionOptionsMenuItem,
action: #selector(openDataBrokerProtection),
keyEquivalent: "")
.targetting(self)
.withImage(NSImage(named: "BurnerWindowIcon2")) // PLACEHOLDER: Change it once we have the final icon
items.append(dataBrokerProtectionItem)
}
#endif // DBP

#if SUBSCRIPTION
Expand Down