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

[cr93 followup] Fixes brave://settings in Guest window. #9805

Merged
merged 1 commit into from
Aug 24, 2021
Merged
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
12 changes: 7 additions & 5 deletions browser/resources/settings/brave_routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
// you can obtain one at http://mozilla.org/MPL/2.0/.

import {pageVisibility} from './brave_overrides/page_visibility.js'
import {loadTimeData} from './i18n_setup.js'

export default function addBraveRoutes(r) {
const isGuest = loadTimeData.getBoolean('isGuest')
if (!r.BASIC) {
console.error('[Brave Settings Overrides] Routes: could not find BASIC page')
}
if (r.SITE_SETTINGS_ADS) {
delete r.SITE_SETTINGS_ADS
} else {
console.error('[Brave Settings Overrides] could not find expected route site_settings_ads')
}
if (pageVisibility.getStarted) {
r.GET_STARTED = r.BASIC.createSection('/getStarted', 'getStarted')
// bring back people's /manageProfile (now in getStarted)
Expand Down Expand Up @@ -43,6 +40,11 @@ export default function addBraveRoutes(r) {
if (isNativeBraveWalletFeatureEnabled) {
r.SITE_SETTINGS_ETHEREUM = r.SITE_SETTINGS.createChild('ethereum')
}
if (r.SITE_SETTINGS_ADS) {
delete r.SITE_SETTINGS_ADS
} else {
console.error('[Brave Settings Overrides] could not find expected route site_settings_ads')
}
} else if (!isGuest) {
console.error('[Brave Settings Overrides] Routes: could not find SITE_SETTINGS page')
}
Expand Down