fix plugin load
This commit is contained in:
		
							parent
							
								
									e4ff3a78fb
								
							
						
					
					
						commit
						387524a407
					
				
					 4 changed files with 9 additions and 2 deletions
				
			
		|  | @ -35,6 +35,7 @@ | |||
|     "multiline-ternary": "off", | ||||
|     "newline-after-var": "off", | ||||
|     "newline-before-return": "off", | ||||
|     "newline-per-chained-call": "off", | ||||
|     "no-bitwise": "off", | ||||
|     "no-console": ["error", { "allow": ["warn", "error"] }], | ||||
|     "no-empty-function": "off", | ||||
|  |  | |||
|  | @ -32,6 +32,10 @@ export default class Common { | |||
|       type: messages.SETTINGS_QUERY, | ||||
|     }).then((settings) => { | ||||
|       this.store.dispatch(settingActions.set(settings)); | ||||
|     }).catch((e) => { | ||||
|       // Sometime sendMessage fails when background script is not ready.
 | ||||
|       console.warn(e); | ||||
|       setTimeout(() => this.reloadSettings(), 500); | ||||
|     }); | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -1,6 +1,8 @@ | |||
| import actions from 'content/actions'; | ||||
| 
 | ||||
| const defaultState = {}; | ||||
| const defaultState = { | ||||
|   keymaps: {}, | ||||
| }; | ||||
| 
 | ||||
| export default function reducer(state = defaultState, action = {}) { | ||||
|   switch (action.type) { | ||||
|  |  | |||
|  | @ -5,7 +5,7 @@ import settingReducer from 'content/reducers/setting'; | |||
| describe("content setting reducer", () => { | ||||
|   it('return the initial state', () => { | ||||
|     let state = settingReducer(undefined, {}); | ||||
|     expect(state).to.deep.equal({}); | ||||
|     expect(state).to.deep.equal({ keymaps: {} }); | ||||
|   }); | ||||
| 
 | ||||
|   it('return next state for SETTING_SET', () => { | ||||
|  |  | |||
		Reference in a new issue