fix but failed
This commit is contained in:
parent
03cf265eff
commit
e2fb33bdc5
20 changed files with 74 additions and 98 deletions
|
@ -8,7 +8,7 @@ import * as consoleFrames from 'content/console-frames';
|
|||
import * as addonActions from './addon';
|
||||
import * as properties from 'shared/settings/properties';
|
||||
|
||||
// eslint-disable-next-line complexity
|
||||
// eslint-disable-next-line complexity, max-lines-per-function
|
||||
const exec = (operation, repeat, settings) => {
|
||||
let smoothscroll = settings.properties.smoothscroll ||
|
||||
properties.defaults.smoothscroll;
|
||||
|
|
|
@ -10,7 +10,7 @@ const reservedKeymaps = {
|
|||
const set = (value) => {
|
||||
let entries = [];
|
||||
if (value.keymaps) {
|
||||
let keymaps = Object.assign({}, value.keymaps, reservedKeymaps);
|
||||
let keymaps = { ...value.keymaps, ...reservedKeymaps };
|
||||
entries = Object.entries(keymaps).map((entry) => {
|
||||
return [
|
||||
keyUtils.fromMapKeys(entry[0]),
|
||||
|
@ -21,9 +21,8 @@ const set = (value) => {
|
|||
|
||||
return {
|
||||
type: actions.SETTING_SET,
|
||||
value: Object.assign({}, value, {
|
||||
keymaps: entries,
|
||||
})
|
||||
value: { ...value,
|
||||
keymaps: entries, }
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -7,17 +7,14 @@ const defaultState = {
|
|||
export default function reducer(state = defaultState, action = {}) {
|
||||
switch (action.type) {
|
||||
case actions.ADDON_ENABLE:
|
||||
return Object.assign({}, state, {
|
||||
enabled: true,
|
||||
});
|
||||
return { ...state,
|
||||
enabled: true, };
|
||||
case actions.ADDON_DISABLE:
|
||||
return Object.assign({}, state, {
|
||||
enabled: false,
|
||||
});
|
||||
return { ...state,
|
||||
enabled: false, };
|
||||
case actions.ADDON_TOGGLE_ENABLED:
|
||||
return Object.assign({}, state, {
|
||||
enabled: !state.enabled,
|
||||
});
|
||||
return { ...state,
|
||||
enabled: !state.enabled, };
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
|
|
@ -8,10 +8,9 @@ const defaultState = {
|
|||
export default function reducer(state = defaultState, action = {}) {
|
||||
switch (action.type) {
|
||||
case actions.FIND_SET_KEYWORD:
|
||||
return Object.assign({}, state, {
|
||||
return { ...state,
|
||||
keyword: action.keyword,
|
||||
found: action.found,
|
||||
});
|
||||
found: action.found, };
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -14,11 +14,12 @@ const defaultState = {
|
|||
};
|
||||
|
||||
export default function reducer(state = defaultState, action = {}) {
|
||||
return Object.assign({}, state, {
|
||||
return {
|
||||
...state,
|
||||
addon: addonReducer(state.addon, action),
|
||||
find: findReducer(state.find, action),
|
||||
setting: settingReducer(state.setting, action),
|
||||
input: inputReducer(state.input, action),
|
||||
followController: followControllerReducer(state.followController, action),
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -7,13 +7,11 @@ const defaultState = {
|
|||
export default function reducer(state = defaultState, action = {}) {
|
||||
switch (action.type) {
|
||||
case actions.INPUT_KEY_PRESS:
|
||||
return Object.assign({}, state, {
|
||||
keys: state.keys.concat([action.key]),
|
||||
});
|
||||
return { ...state,
|
||||
keys: state.keys.concat([action.key]), };
|
||||
case actions.INPUT_CLEAR_KEYS:
|
||||
return Object.assign({}, state, {
|
||||
keys: [],
|
||||
});
|
||||
return { ...state,
|
||||
keys: [], };
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ const defaultState = {
|
|||
export default function reducer(state = defaultState, action = {}) {
|
||||
switch (action.type) {
|
||||
case actions.SETTING_SET:
|
||||
return Object.assign({}, action.value);
|
||||
return { ...action.value };
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
|
Reference in a new issue