File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import { MRC_STYLE_COMPONENTS } from '../themes/styles'
2626import { createFieldNonEditableText } from '../fields/FieldNonEditableText' ;
2727import { Editor } from '../editor/editor' ;
2828import { ExtendedPythonGenerator } from '../editor/extended_python_generator' ;
29+ import { getModuleTypeForWorkspace } from './utils/workspaces' ;
2930import { getAllowedTypesForSetCheck , getClassData , getSubclassNames } from './utils/python' ;
3031import * as toolboxItems from '../toolbox/items' ;
3132import * as storageModule from '../storage/module' ;
@@ -142,8 +143,8 @@ const COMPONENT = {
142143 * Update the block to reflect the newly loaded extra state.
143144 */
144145 updateBlock_ : function ( this : ComponentBlock ) : void {
145- const editor = Editor . getEditorForBlocklyWorkspace ( this . workspace , true /* returnCurrentIfNotFound */ ) ;
146- if ( editor && editor . getModuleType ( ) === storageModule . ModuleType . ROBOT ) {
146+ const moduleType = getModuleTypeForWorkspace ( this . workspace ) ;
147+ if ( moduleType === storageModule . ModuleType . ROBOT ) {
147148 // Add input sockets for the arguments.
148149 for ( let i = 0 ; i < this . mrcArgs . length ; i ++ ) {
149150 const input = this . appendValueInput ( 'ARG' + i )
You can’t perform that action at this time.
0 commit comments