Skip to content

Commit

Permalink
fix(browserAction): hide redirect controls in automatic mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Mar 18, 2017
1 parent 20436d6 commit 49a8d6a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions add-on/src/popup/browser-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function hide (id) {
}

function set (id, value) {
document.getElementById(id).innerHTML = value
document.getElementById(id).textContent = value
}

quickUpload.onclick = () => browser.tabs.create({ url: browser.extension.getURL('src/popup/quick-upload.html') })
Expand Down Expand Up @@ -52,7 +52,7 @@ openPreferences.onclick = () => {

function updatePopup () {
// update redirect status
browser.storage.local.get('useCustomGateway')
browser.storage.local.get(['useCustomGateway', 'automaticMode'])
.then(options => {
const enabled = options['useCustomGateway']
if (enabled) {
Expand All @@ -66,6 +66,9 @@ function updatePopup () {
show('redirect-disabled')
show('enable-gateway-redirect')
}
if (options['automaticMode']) {
hide('toggle-gateway-redirect')
}
})
.catch(error => {
console.error(`Unable update redirect state due to ${error}`)
Expand Down

0 comments on commit 49a8d6a

Please sign in to comment.