aboutsummaryrefslogtreecommitdiff
path: root/src/console
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-05-02 14:08:51 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2019-05-05 23:59:59 +0900
commitd01db82c0dca352de2d7644c383d388fc3ec0366 (patch)
treeff09ebc545ce00192dff9e1119b0c9e2cf92fdef /src/console
parent992b3ac65d7fe86ac7bc3b560960c8bcf86bec69 (diff)
Types src/content
Diffstat (limited to 'src/console')
-rw-r--r--src/console/actions/console.ts2
-rw-r--r--src/console/index.tsx11
2 files changed, 7 insertions, 6 deletions
diff --git a/src/console/actions/console.ts b/src/console/actions/console.ts
index ceb419c..b1494b0 100644
--- a/src/console/actions/console.ts
+++ b/src/console/actions/console.ts
@@ -1,4 +1,4 @@
-import messages from '../../shared/messages';
+import * as messages from '../../shared/messages';
import * as actions from './index';
const hide = (): actions.ConsoleAction => {
diff --git a/src/console/index.tsx b/src/console/index.tsx
index ee3a8ee..b655154 100644
--- a/src/console/index.tsx
+++ b/src/console/index.tsx
@@ -1,4 +1,4 @@
-import messages from '../shared/messages';
+import * as messages from '../shared/messages';
import reducers from './reducers';
import { createStore, applyMiddleware } from 'redux';
import promise from 'redux-promise';
@@ -23,15 +23,16 @@ window.addEventListener('load', () => {
});
const onMessage = (message: any): any => {
- switch (message.type) {
+ let msg = messages.valueOf(message);
+ switch (msg.type) {
case messages.CONSOLE_SHOW_COMMAND:
- return store.dispatch(consoleActions.showCommand(message.command));
+ return store.dispatch(consoleActions.showCommand(msg.command));
case messages.CONSOLE_SHOW_FIND:
return store.dispatch(consoleActions.showFind());
case messages.CONSOLE_SHOW_ERROR:
- return store.dispatch(consoleActions.showError(message.text));
+ return store.dispatch(consoleActions.showError(msg.text));
case messages.CONSOLE_SHOW_INFO:
- return store.dispatch(consoleActions.showInfo(message.text));
+ return store.dispatch(consoleActions.showInfo(msg.text));
case messages.CONSOLE_HIDE:
return store.dispatch(consoleActions.hide());
}