From e2fb33bdc513385e9d71bc5b3d5068f7db9713d7 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Thu, 28 Jun 2018 20:44:57 +0900 Subject: fix but failed --- src/content/reducers/follow-controller.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/content/reducers/follow-controller.js') diff --git a/src/content/reducers/follow-controller.js b/src/content/reducers/follow-controller.js index 78fd848..5869c47 100644 --- a/src/content/reducers/follow-controller.js +++ b/src/content/reducers/follow-controller.js @@ -10,24 +10,20 @@ const defaultState = { export default function reducer(state = defaultState, action = {}) { switch (action.type) { case actions.FOLLOW_CONTROLLER_ENABLE: - return Object.assign({}, state, { + return { ...state, enabled: true, newTab: action.newTab, background: action.background, - keys: '', - }); + keys: '', }; case actions.FOLLOW_CONTROLLER_DISABLE: - return Object.assign({}, state, { - enabled: false, - }); + return { ...state, + enabled: false, }; case actions.FOLLOW_CONTROLLER_KEY_PRESS: - return Object.assign({}, state, { - keys: state.keys + action.key, - }); + return { ...state, + keys: state.keys + action.key, }; case actions.FOLLOW_CONTROLLER_BACKSPACE: - return Object.assign({}, state, { - keys: state.keys.slice(0, -1), - }); + return { ...state, + keys: state.keys.slice(0, -1), }; default: return state; } -- cgit v1.2.3