Skip to content

Commit

Permalink
CLI fixes (#122)
Browse files Browse the repository at this point in the history
* Rounds the action milliseconds in the cli.

* Fixes the welcome message when a client connects.
  • Loading branch information
skellock committed Aug 15, 2016
1 parent d5a5642 commit 93b5e95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/reactotron-cli/src/ui/drawing.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ export default (layout, config) => {

const drawStateActionComplete = payload => {
const {name, ms, action} = payload
const msText = ms && Number(ms).toFixed(0)
const msSuffix = ms && 'ms'
const time = timeStamp()
layout.stateActionBox.log(`${time} {cyan-fg}${name}{/}{|}{white-fg}${ms}{/}ms`)
layout.stateActionBox.log(`${time} {cyan-fg}${name}{/}{|}{white-fg}${msText}{/}${msSuffix}`)
if (config.stateActionLoggingStyle === 'full') {
layout.stateActionBox.log(action)
layout.stateActionBox.log('')
Expand Down
4 changes: 2 additions & 2 deletions packages/reactotron-cli/src/ui/reactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default (context) => {

// when clients come & go
observe(server.connections, ({added, removed}) => {
R.forEach(ui.drawConnection, added)
R.forEach(ui.drawDisconnection, removed)
})

Expand All @@ -24,7 +23,8 @@ export default (context) => {
{ command: 'state.action.complete', handler: ui.drawStateActionComplete },
{ command: 'state.keys.response', handler: ui.drawStateKeysResponse },
{ command: 'state.values.response', handler: ui.drawStateValuesResponse },
{ command: 'state.values.change', handler: ui.drawStateValuesChange }
{ command: 'state.values.change', handler: ui.drawStateValuesChange },
{ command: 'client.intro', handler: ui.drawConnection }
]

// how we hook that up
Expand Down

0 comments on commit 93b5e95

Please sign in to comment.