aboutsummaryrefslogtreecommitdiff
path: root/src/content/reducers
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/reducers')
-rw-r--r--src/content/reducers/index.ts4
-rw-r--r--src/content/reducers/setting.ts40
2 files changed, 1 insertions, 43 deletions
diff --git a/src/content/reducers/index.ts b/src/content/reducers/index.ts
index 6f11512..21e8918 100644
--- a/src/content/reducers/index.ts
+++ b/src/content/reducers/index.ts
@@ -1,6 +1,5 @@
import { combineReducers } from 'redux';
import find, { State as FindState } from './find';
-import setting, { State as SettingState } from './setting';
import input, { State as InputState } from './input';
import followController, { State as FollowControllerState }
from './follow-controller';
@@ -8,12 +7,11 @@ import mark, { State as MarkState } from './mark';
export interface State {
find: FindState;
- setting: SettingState;
input: InputState;
followController: FollowControllerState;
mark: MarkState;
}
export default combineReducers({
- find, setting, input, followController, mark,
+ find, input, followController, mark,
});
diff --git a/src/content/reducers/setting.ts b/src/content/reducers/setting.ts
deleted file mode 100644
index 9ca1380..0000000
--- a/src/content/reducers/setting.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import * as actions from '../actions';
-import * as keyUtils from '../../shared/utils/keys';
-import * as operations from '../../shared/operations';
-import { Search, Properties, DefaultSetting } from '../../shared/Settings';
-
-export interface State {
- keymaps: { key: keyUtils.Key[], op: operations.Operation }[];
- search: Search;
- properties: Properties;
-}
-
-// defaultState does not refer due to the state is load from
-// background on load.
-const defaultState: State = {
- keymaps: [],
- search: DefaultSetting.search,
- properties: DefaultSetting.properties,
-};
-
-export default function reducer(
- state: State = defaultState,
- action: actions.SettingAction,
-): State {
- switch (action.type) {
- case actions.SETTING_SET:
- return {
- keymaps: Object.entries(action.settings.keymaps).map((entry) => {
- return {
- key: keyUtils.fromMapKeys(entry[0]),
- op: entry[1],
- };
- }),
- properties: action.settings.properties,
- search: action.settings.search,
- };
- default:
- return state;
- }
-}
-