LogMonitor now attempts to call .toJS() on state entries.

This commit is contained in:
David Zukowski 2015-08-15 12:43:59 -04:00
parent b09d171f2d
commit 634b8e8557

View File

@ -144,6 +144,20 @@ export default class LogMonitor {
const action = stagedActions[i]; const action = stagedActions[i];
const { state, error } = computedStates[i]; const { state, error } = computedStates[i];
let previousState; 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) { if (i > 0) {
previousState = computedStates[i - 1].state; previousState = computedStates[i - 1].state;
} }
@ -153,7 +167,7 @@ export default class LogMonitor {
theme={theme} theme={theme}
select={select} select={select}
action={action} action={action}
state={state} state={readableState}
previousState={previousState} previousState={previousState}
collapsed={skippedActions[i]} collapsed={skippedActions[i]}
error={error} error={error}