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

Removes Rewards item from app menu for OFAC countries. (uplift to 1.48.x) #16560

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 1 addition & 3 deletions browser/ui/brave_browser_command_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ void BraveBrowserCommandController::InitBraveCommandState() {
if (!is_guest_session) {
// If Rewards is not supported due to OFAC sanctions we still want to show
// the menu item.
if (brave_rewards::IsSupported(
browser_->profile()->GetPrefs(),
brave_rewards::IsSupportedOptions::kSkipRegionCheck)) {
if (brave_rewards::IsSupported(browser_->profile()->GetPrefs())) {
UpdateCommandForBraveRewards();
}
if (brave_wallet::IsAllowed(browser_->profile()->GetPrefs())) {
Expand Down
2 changes: 1 addition & 1 deletion browser/ui/webui/navigation_bar_data_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void NavigationBarDataProvider::Initialize(content::WebUIDataSource* source,
source->AddLocalizedString("brToolbarWalletsTitle", IDS_WALLETS_TITLE);

source->AddBoolean(
"isBraveRewardsSupported",
"brToolbarShowRewardsButton",
brave_rewards::IsSupportedForProfile(
profile, brave_rewards::IsSupportedOptions::kSkipRegionCheck));
source->AddBoolean("isBraveWalletAllowed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<span class="nav-item_text">[[settingsTitle]]</span>
</a>
</li>
<template is="dom-if" if="[[isBraveRewardsSupported_]]">
<template is="dom-if" if="[[shouldShowRewardsButton_]]">
<li class="nav-items_list-item" title="[[braveRewardsTitle]]">
<a class$="nav-item [[getNavItemSelectedClassName('rewards')]]" href="chrome://rewards">
<span class="nav-item_icon">
Expand Down
5 changes: 3 additions & 2 deletions ui/webui/resources/br_elements/br_toolbar/br_toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Polymer({
reflectToAttribute: true,
},

isBraveRewardsSupported_: {
shouldShowRewardsButton_: {
type: Boolean,
value: true,
},
Expand Down Expand Up @@ -193,7 +193,8 @@ Polymer({

/** @override */
attached: function () {
this.isBraveRewardsSupported_ = loadTimeData.getBoolean('isBraveRewardsSupported')
this.shouldShowRewardsButton_ =
loadTimeData.getBoolean('brToolbarShowRewardsButton')
this.isBraveWalletAllowed_ = loadTimeData.getBoolean('isBraveWalletAllowed')
this.initSlotFilledDetection()
this.initStrings()
Expand Down