diff --git a/browser/resources/settings/brave_routes.js b/browser/resources/settings/brave_routes.js index 30616d29990e..25c79d45684f 100644 --- a/browser/resources/settings/brave_routes.js +++ b/browser/resources/settings/brave_routes.js @@ -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) @@ -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') }