aboutsummaryrefslogtreecommitdiff
path: root/src/console/index.tsx
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2020-05-02 17:25:56 +0900
committerGitHub <noreply@github.com>2020-05-02 17:25:56 +0900
commit5df0537bcf65a341e79852b1b30379c73318529c (patch)
treeaee5efe52412855f620cb514a13a2c14373f27b7 /src/console/index.tsx
parent685f2b7b69218b06b5bb676069e35f79c5048c9b (diff)
parent75abd90ecb8201ad845b266f96220d8adfe19b2d (diff)
Merge pull request #749 from ueokande/qa-0.28
QA 0.28
Diffstat (limited to 'src/console/index.tsx')
-rw-r--r--src/console/index.tsx54
1 files changed, 26 insertions, 28 deletions
diff --git a/src/console/index.tsx b/src/console/index.tsx
index 7bee746..e1a9dd3 100644
--- a/src/console/index.tsx
+++ b/src/console/index.tsx
@@ -1,43 +1,41 @@
-import * as messages from '../shared/messages';
-import reducers from './reducers';
-import { createStore, applyMiddleware } from 'redux';
-import promise from 'redux-promise';
-import * as consoleActions from './actions/console';
-import { Provider } from 'react-redux';
-import Console from './components/Console';
-import React from 'react';
-import ReactDOM from 'react-dom';
+import * as messages from "../shared/messages";
+import reducers from "./reducers";
+import { createStore, applyMiddleware } from "redux";
+import promise from "redux-promise";
+import * as consoleActions from "./actions/console";
+import { Provider } from "react-redux";
+import Console from "./components/Console";
+import React from "react";
+import ReactDOM from "react-dom";
-const store = createStore(
- reducers,
- applyMiddleware(promise),
-);
+const store = createStore(reducers, applyMiddleware(promise));
-window.addEventListener('load', () => {
- const wrapper = document.getElementById('vimvixen-console');
+window.addEventListener("load", () => {
+ const wrapper = document.getElementById("vimvixen-console");
ReactDOM.render(
- <Provider store={store} >
+ <Provider store={store}>
<Console></Console>
</Provider>,
- wrapper);
+ wrapper
+ );
});
const onMessage = async (message: any): Promise<any> => {
const msg = messages.valueOf(message);
switch (msg.type) {
- case messages.CONSOLE_SHOW_COMMAND:
- return store.dispatch(await consoleActions.showCommand(msg.command));
- case messages.CONSOLE_SHOW_FIND:
- return store.dispatch(consoleActions.showFind());
- case messages.CONSOLE_SHOW_ERROR:
- return store.dispatch(consoleActions.showError(msg.text));
- case messages.CONSOLE_SHOW_INFO:
- return store.dispatch(consoleActions.showInfo(msg.text));
- case messages.CONSOLE_HIDE:
- return store.dispatch(consoleActions.hide());
+ case messages.CONSOLE_SHOW_COMMAND:
+ return store.dispatch(await consoleActions.showCommand(msg.command));
+ case messages.CONSOLE_SHOW_FIND:
+ return store.dispatch(consoleActions.showFind());
+ case messages.CONSOLE_SHOW_ERROR:
+ return store.dispatch(consoleActions.showError(msg.text));
+ case messages.CONSOLE_SHOW_INFO:
+ return store.dispatch(consoleActions.showInfo(msg.text));
+ case messages.CONSOLE_HIDE:
+ return store.dispatch(consoleActions.hide());
}
};
browser.runtime.onMessage.addListener(onMessage);
-const port = browser.runtime.connect(undefined, { name: 'vimvixen-console' });
+const port = browser.runtime.connect(undefined, { name: "vimvixen-console" });
port.onMessage.addListener(onMessage);