Skip to content

Commit

Permalink
Merge pull request #16560 from brave/pr16557_maxk-remove-rewards-from…
Browse files Browse the repository at this point in the history
…-app-menu-for-ofac_1.48.x

Removes Rewards item from app menu for OFAC countries. (uplift to 1.48.x)
  • Loading branch information
kjozwiak authored Jan 9, 2023
2 parents 7bb78cc + be164fd commit 0ed070a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
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
2 changes: 1 addition & 1 deletion ui/webui/resources/br_elements/br_toolbar/br_toolbar.html
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

0 comments on commit 0ed070a

Please sign in to comment.