From 7d1226458f17dfc56c285c668bf78f41d8c1ce2e Mon Sep 17 00:00:00 2001 From: Karishma Chadha Date: Thu, 8 Nov 2018 00:37:49 -0500 Subject: [PATCH] Fix import of current day of week block from sb2. --- src/serialization/sb2.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/serialization/sb2.js b/src/serialization/sb2.js index 4fa8bba53..363a70523 100644 --- a/src/serialization/sb2.js +++ b/src/serialization/sb2.js @@ -297,6 +297,7 @@ const parseMonitorObject = (object, runtime, targets, extensions) => { } else if (object.cmd === 'contentsOfList:') { block.id = getVariableId(object.param, Variable.LIST_TYPE); } else if (runtime.monitorBlockInfo.hasOwnProperty(block.opcode)) { + if (object.param === 'day of week') object.param = 'DAYOFWEEK'; block.id = runtime.monitorBlockInfo[block.opcode].getId(target.id, [object.param]); } else { // If the opcode can't be found in the runtime monitorBlockInfo, @@ -1028,6 +1029,10 @@ const parseBlock = function (sb2block, addBroadcastMsg, getVariableId, extension value: providedArg }; + if (expectedArg.fieldName === 'CURRENTMENU' && providedArg === 'day of week') { + activeBlock.fields[expectedArg.fieldName].value = 'DAYOFWEEK'; + } + if (expectedArg.fieldName === 'VARIABLE') { // Add `id` property to variable fields activeBlock.fields[expectedArg.fieldName].id = getVariableId(providedArg, Variable.SCALAR_TYPE);