Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #8470 from NejcZdovc/hotfix/#8452-torrent
Browse files Browse the repository at this point in the history
Fixes torrent download when torrent viewer is disabled
  • Loading branch information
bsclifton committed Apr 24, 2017
2 parents 0f41941 + d87c78d commit 64467a8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const {adBlockResourceName} = require('./adBlock')
const {updateElectronDownloadItem} = require('./browser/electronDownloadItem')
const {fullscreenOption} = require('./common/constants/settingsEnums')
const isThirdPartyHost = require('./browser/isThirdPartyHost')
var extensionState = require('./common/state/extensionState.js')

let appStore = null

Expand Down Expand Up @@ -664,11 +665,17 @@ module.exports.isResourceEnabled = (resourceName, url, isPrivate) => {
// TODO(bridiver) - need to clean up the rest of this so web can
// remove this because it duplicates checks made in siteSettings
// and not all resources are controlled by shields up/down
if (resourceName === 'flash' || resourceName === 'webtorrent') {
if (resourceName === 'flash') {
return true
}

const appState = appStore.getState()

if (resourceName === 'webtorrent') {
const extension = extensionState.getExtensionById(appState, config.torrentExtensionId)
return extension !== undefined ? extension.get('enabled') : false
}

const settings = siteSettings.getSiteSettingsForURL(appState.get('siteSettings'), url)
const tempSettings = siteSettings.getSiteSettingsForURL(appState.get('temporarySiteSettings'), url)

Expand Down

0 comments on commit 64467a8

Please sign in to comment.