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 #8828 from brave/fix/flash-always-deny
Browse files Browse the repository at this point in the history
fix flash always-deny setting
  • Loading branch information
diracdeltas authored May 18, 2017
2 parents 065b51a + 6528ab9 commit 8c73ba3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/browser/reducers/flashReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

const appConstants = require('../../../js/constants/appConstants')
const flash = require('../../../js/flash')
const siteSettings = require('../../../js/state/siteSettings')
const {makeImmutable} = require('../../common/state/immutableUtil')

const flashReducer = (state, action, immutableAction) => {
Expand All @@ -15,8 +16,14 @@ const flashReducer = (state, action, immutableAction) => {
flash.init()
break
case appConstants.APP_FLASH_PERMISSION_REQUESTED:
flash.showFlashMessageBox(action.get('location'), action.get('senderTabId'))
break
{
const location = action.get('location')
const settings = siteSettings.getSiteSettingsForURL(state.get('siteSettings'), location)
if (!(settings && ['boolean', 'number'].includes(typeof settings.get('flash')))) {
flash.showFlashMessageBox(location, action.get('senderTabId'))
}
break
}
}
return state
}
Expand Down

0 comments on commit 8c73ba3

Please sign in to comment.