diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-02 14:08:51 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-05 23:59:59 +0900 |
commit | d01db82c0dca352de2d7644c383d388fc3ec0366 (patch) | |
tree | ff09ebc545ce00192dff9e1119b0c9e2cf92fdef /src/console/index.tsx | |
parent | 992b3ac65d7fe86ac7bc3b560960c8bcf86bec69 (diff) |
Types src/content
Diffstat (limited to 'src/console/index.tsx')
-rw-r--r-- | src/console/index.tsx | 11 |
1 files changed, 6 insertions, 5 deletions
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()); } |