fix console errors

This commit is contained in:
Shin'ya Ueoka 2017-10-07 11:00:34 +09:00
parent 45368384d1
commit 9fb7bf96be
3 changed files with 19 additions and 8 deletions

View file

@ -1,5 +1,5 @@
import * as consoleActions from 'actions/console';
import * as settingsActions from 'actions/setting';
import messages from 'content/messages';
import BackgroundComponent from 'components/background';
import BackgroundInputComponent from 'components/background-input';
import reducers from 'reducers';
@ -8,7 +8,10 @@ import { createStore } from 'store';
const store = createStore(reducers, (e, sender) => {
console.error('Vim-Vixen:', e);
if (sender) {
store.dispatch(consoleActions.showError(e.message), sender);
return browser.tabs.sendMessage(sender.tab.id, {
type: messages.CONSOLE_SHOW_ERROR,
text: e.message,
});
}
});
const backgroundComponent = new BackgroundComponent(store);