Skip to content

Commit

Permalink
[1.3] Hide sync option from settings if it's disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhong committed Feb 14, 2020
1 parent ec19972 commit a2a673f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions browser/resources/settings/brave_settings_overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,15 @@ BravePatching.RegisterPolymerTemplateModifications({
// Move Appearance item
const appearanceBrowserEl = getMenuElement(templateContent, '/appearance')
getStartedEl.insertAdjacentElement('afterend', appearanceBrowserEl)
// Add Sync item
const syncEl = createMenuElement(loadTimeData.getString('braveSync'), '/braveSync', 'brave_settings:sync')
appearanceBrowserEl.insertAdjacentElement('afterend', syncEl)
// Add Shields item
// Add Sync and Shields item
const shieldsEl = createMenuElement(loadTimeData.getString('braveShieldsTitle'), '/shields', 'brave_settings:shields')
syncEl.insertAdjacentElement('afterend', shieldsEl)
if (loadTimeData.getBoolean('isSyncDisabled')) {
appearanceBrowserEl.insertAdjacentElement('afterend', shieldsEl)
} else {
const syncEl = createMenuElement(loadTimeData.getString('braveSync'), '/braveSync', 'brave_settings:sync')
appearanceBrowserEl.insertAdjacentElement('afterend', syncEl)
syncEl.insertAdjacentElement('afterend', shieldsEl)
}
// Add Embed Blocking item
const embedEl = createMenuElement(loadTimeData.getString('socialBlocking'), '/socialBlocking', 'brave_settings:social-permissions')
shieldsEl.insertAdjacentElement('afterend', embedEl)
Expand Down

0 comments on commit a2a673f

Please sign in to comment.