Use official redux on content

This commit is contained in:
Shin'ya Ueoka 2018-07-07 22:05:22 +09:00
parent cf0dcf2522
commit efa1cb3967
11 changed files with 36 additions and 103 deletions

View file

@ -9,7 +9,7 @@ import * as addonActions from './addon';
import * as properties from 'shared/settings/properties';
// eslint-disable-next-line complexity, max-lines-per-function
const exec = (operation, repeat, settings) => {
const exec = (operation, repeat, settings, addonEnabled) => {
let smoothscroll = settings.properties.smoothscroll ||
properties.defaults.smoothscroll;
switch (operation.type) {
@ -18,7 +18,7 @@ const exec = (operation, repeat, settings) => {
case operations.ADDON_DISABLE:
return addonActions.disable();
case operations.ADDON_TOGGLE_ENABLED:
return addonActions.toggleEnabled();
return addonActions.setEnabled(!addonEnabled);
case operations.FIND_NEXT:
window.top.postMessage(JSON.stringify({
type: messages.FIND_NEXT,