File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -1507,6 +1507,24 @@ Entry.VariableContainer = class VariableContainer {
15071507 this . updateList ( ) ;
15081508 }
15091509
1510+ removeNotPythonSupportedFunction ( ) {
1511+ const functions = this . functions_ ;
1512+ Object . values ( functions ) . forEach ( ( func ) => {
1513+ const isNotPythonSupport = func . useLocalVariables || func . type === 'value' ;
1514+ if ( isNotPythonSupport ) {
1515+ const functionId = func . id ;
1516+ func . destroy ( ) ;
1517+ delete functions [ functionId ] ;
1518+ const functionType = `func_${ functionId } ` ;
1519+ Entry . container . removeFuncBlocks ( functionType ) ;
1520+ for ( const id in functions ) {
1521+ functions [ id ] . content . removeBlocksByType ( functionType ) ;
1522+ }
1523+ }
1524+ } ) ;
1525+ this . updateList ( ) ;
1526+ }
1527+
15101528 checkListPosition ( list , mouse ) {
15111529 const pos = {
15121530 start_w : list . x_ ,
Original file line number Diff line number Diff line change @@ -198,13 +198,17 @@ Entry.Workspace = class Workspace {
198198 if ( alertMessage . type === 'warning' ) {
199199 Entry . modal . confirm ( alertMessage . message ) . then ( ( result ) => {
200200 if ( result ) {
201+ Entry . variableContainer . removeNotPythonSupportedFunction ( ) ;
201202 Entry . expansion . banExpansionBlocks ( Entry . expansionBlocks ) ;
202203 Entry . aiUtilize . banAIUtilizeBlocks ( Entry . aiUtilizeBlocks ) ;
203204 Entry . hwLite . banClassAllHardwareLite ( ) ;
204205 Entry . playground . dataTable . removeAllBlocks ( ) ;
205206 Entry . aiLearning . removeAllBlocks ( ) ;
206- changeToPythonMode ( ) ;
207- dispatchChangeBoardEvent ( ) ;
207+ // 블럭 삭제되고 처리
208+ requestAnimationFrame ( ( ) => {
209+ changeToPythonMode ( ) ;
210+ dispatchChangeBoardEvent ( ) ;
211+ } ) ;
208212 } else {
209213 const mode = { } ;
210214 mode . boardType = WORKSPACE . MODE_BOARD ;
You can’t perform that action at this time.
0 commit comments