aboutsummaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
Diffstat (limited to 'src/content')
-rw-r--r--src/content/components/common/index.js4
-rw-r--r--src/content/reducers/setting.js4
2 files changed, 7 insertions, 1 deletions
diff --git a/src/content/components/common/index.js b/src/content/components/common/index.js
index 4c2c1df..565632c 100644
--- a/src/content/components/common/index.js
+++ b/src/content/components/common/index.js
@@ -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);
});
}
}
diff --git a/src/content/reducers/setting.js b/src/content/reducers/setting.js
index 22fac6f..b6f6c58 100644
--- a/src/content/reducers/setting.js
+++ b/src/content/reducers/setting.js
@@ -1,6 +1,8 @@
import actions from 'content/actions';
-const defaultState = {};
+const defaultState = {
+ keymaps: {},
+};
export default function reducer(state = defaultState, action = {}) {
switch (action.type) {