From 6528ab99e51590d9b3f3810345403f706bfcc674 Mon Sep 17 00:00:00 2001 From: yan Date: Wed, 10 May 2017 23:52:40 +0000 Subject: [PATCH] fix flash always-deny setting 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 --- app/browser/reducers/flashReducer.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/browser/reducers/flashReducer.js b/app/browser/reducers/flashReducer.js index 58d37ad3b8e..4a2f2098d84 100644 --- a/app/browser/reducers/flashReducer.js +++ b/app/browser/reducers/flashReducer.js @@ -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) => { @@ -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 }