aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-11-03 14:54:13 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-11-05 07:47:05 +0900
commit387524a407be74c3d52758c2b98ef1f93c4289da (patch)
treee12cda099fd5c574364d328b5fd2a45f7e779f97 /src
parente4ff3a78fbb8aed79292b20e89ca0f5e75a4a0bf (diff)
fix plugin load
Diffstat (limited to 'src')
-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) {