From 634b8e8557a5e63d00828fda6d170da4e4e051a3 Mon Sep 17 00:00:00 2001 From: David Zukowski Date: Sat, 15 Aug 2015 12:43:59 -0400 Subject: [PATCH] LogMonitor now attempts to call .toJS() on state entries. --- src/react/LogMonitor.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/react/LogMonitor.js b/src/react/LogMonitor.js index fffc81fb..dbeac6a1 100644 --- a/src/react/LogMonitor.js +++ b/src/react/LogMonitor.js @@ -144,6 +144,20 @@ export default class LogMonitor { const action = stagedActions[i]; const { state, error } = computedStates[i]; let previousState; + + const readableState = {}; + for (const prop in state) { + if ( + state.hasOwnProperty(prop) && + typeof state[prop] === 'object' && + typeof state[prop].toJS === 'function' + ) { + readableState = state[prop].toJS(); + } else { + readableState = state[prop]; + } + } + if (i > 0) { previousState = computedStates[i - 1].state; } @@ -153,7 +167,7 @@ export default class LogMonitor { theme={theme} select={select} action={action} - state={state} + state={readableState} previousState={previousState} collapsed={skippedActions[i]} error={error}