From d690c76a34b1fa6e72ccfd3d55ed60d3f3a6314f Mon Sep 17 00:00:00 2001 From: Karishma Chadha Date: Sun, 21 Oct 2018 00:23:08 -0400 Subject: [PATCH] Update sb2 deserialization of monitors. --- src/serialization/sb2.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/serialization/sb2.js b/src/serialization/sb2.js index d45fbffe1..cab31f7e1 100644 --- a/src/serialization/sb2.js +++ b/src/serialization/sb2.js @@ -287,7 +287,7 @@ const parseMonitorObject = (object, runtime, targets, extensions) => { {}, null, // `comments`, not needed for monitor blocks null // `commentIndex`, not needed for monitor blocks - ); + ); // This block is needed for the `getBlockParams` call down below // Monitor blocks have special IDs to match the toolbox obtained from the getId // function in the runtime.monitorBlocksInfo. Variable monitors, however, @@ -326,6 +326,9 @@ const parseMonitorObject = (object, runtime, targets, extensions) => { runtime.monitorBlocks.createBlock(newBlocks[i]); } } + // In the case where a monitor block does not already exist, one will get created + // when the target is installed because the toolbox will reload. + // Convert numbered mode into strings for better understandability. switch (object.mode) {