diff --git a/pxtblocks/contextMenu/contextMenu.ts b/pxtblocks/contextMenu/contextMenu.ts index 855b32587454..e1e85ddbae31 100644 --- a/pxtblocks/contextMenu/contextMenu.ts +++ b/pxtblocks/contextMenu/contextMenu.ts @@ -28,13 +28,13 @@ export function initContextMenu() { } export function setupWorkspaceContextMenu(workspace: Blockly.WorkspaceSvg) { - Blockly.ContextMenuItems.registerCommentOptions(); + try { + Blockly.ContextMenuItems.registerCommentOptions(); + } + catch (e) { + // will throw if already registered. ignore + } workspace.configureContextMenu = (options, e) => { - if (workspace.options.comments && !workspace.options.readOnly) { - // options.unshift(Blockly.ContextMenu.workspaceCommentOption(workspace, e)) - - } - onWorkspaceContextMenu(workspace, options); }; } \ No newline at end of file