From 98e62b065e6d5a2a9d4c51de4d1d8126e97de572 Mon Sep 17 00:00:00 2001 From: Steve Kellock Date: Mon, 15 Aug 2016 17:44:50 -0400 Subject: [PATCH 1/2] Rounds the action milliseconds in the cli. --- packages/reactotron-cli/src/ui/drawing.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/reactotron-cli/src/ui/drawing.js b/packages/reactotron-cli/src/ui/drawing.js index 6684d552e..b7d79ed66 100644 --- a/packages/reactotron-cli/src/ui/drawing.js +++ b/packages/reactotron-cli/src/ui/drawing.js @@ -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('') From 26c9d8efe44be7ec61943f2df82ef68576819f4b Mon Sep 17 00:00:00 2001 From: Steve Kellock Date: Mon, 15 Aug 2016 17:47:51 -0400 Subject: [PATCH 2/2] Fixes the welcome message when a client connects. --- packages/reactotron-cli/src/ui/reactions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/reactotron-cli/src/ui/reactions.js b/packages/reactotron-cli/src/ui/reactions.js index 14de253cd..903e5d5a5 100644 --- a/packages/reactotron-cli/src/ui/reactions.js +++ b/packages/reactotron-cli/src/ui/reactions.js @@ -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) }) @@ -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