Skip to content

Commit 352845e

Browse files
committed
1 parent 96dfe03 commit 352845e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/lib/monitor-adapter.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const isUndefined = a => typeof a === 'undefined';
1515
* @param {VirtualMachine} block.vm - the VM instance which owns the block
1616
* @return {object} The adapted monitor with label and category
1717
*/
18-
export default function ({id, spriteName, opcode, params, value, vm}) {
18+
export default function ({id, mode, spriteName, opcode, params, value, vm}) {
1919
// Extension monitors get their labels from the Runtime through `getLabelForOpcode`.
2020
// Other monitors' labels are hard-coded in `OpcodeLabels`.
2121
let {label, category, labelFn} = (vm && vm.runtime.getLabelForOpcode(opcode)) || OpcodeLabels.getLabel(opcode);
@@ -33,9 +33,9 @@ export default function ({id, spriteName, opcode, params, value, vm}) {
3333
value = Number(value.toFixed(6));
3434
}
3535

36-
// Convert to a string now. That should help avoid unnecessary re-renders in a few edge cases.
36+
// Convert scalars to a string now. That should help avoid unnecessary re-renders in a few edge cases.
3737
// For lists, we stringify when we display the list row instead of doing a full list copy on every change.
38-
if (!Array.isArray(value)) {
38+
if (mode !== 'list') {
3939
value = safeStringify(value);
4040
}
4141

0 commit comments

Comments
 (0)