diff --git a/src/containers/slider-monitor.jsx b/src/containers/slider-monitor.jsx index b6f43eed5..f818a07bd 100644 --- a/src/containers/slider-monitor.jsx +++ b/src/containers/slider-monitor.jsx @@ -15,7 +15,7 @@ class SliderMonitor extends React.Component { ]); this.state = { - value: Number(props.value) + value: props.value }; } componentWillReceiveProps (nextProps) { diff --git a/src/lib/monitor-adapter.js b/src/lib/monitor-adapter.js index a1d2237c7..d7bdd304e 100644 --- a/src/lib/monitor-adapter.js +++ b/src/lib/monitor-adapter.js @@ -28,6 +28,16 @@ export default function ({id, spriteName, opcode, params, value}) { if (typeof value === 'number') { value = Number(value.toFixed(6)); } - + + // Turn the value to a string, for handle boolean values + if (typeof value === 'boolean') { + value = value.toString(); + } + + // Lists can contain booleans, which should also be turned to strings + if (Array.isArray(value)) { + value = value.map(item => item.toString()); + } + return {id, label, category, value}; }