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

Commit

Permalink
fix flash always-deny setting
Browse files Browse the repository at this point in the history
fix #8826

Test Plan:
1. enable flash
2. go to http://homestarrunner.com/
3. you should see a Flash notification bar. click 'remember this decision' and 'deny'
4. close the tab and open http://homestarrunner.com/ in a new tab
5. you should not see a Flash notification bar this time
  • Loading branch information
diracdeltas committed May 10, 2017
1 parent 9e50872 commit 6528ab9
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 6528ab9

Please sign in to comment.