File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -458,15 +458,16 @@ class Blocks {
458458 if ( ! this . _blocks . hasOwnProperty ( e . blockId ) ) return ;
459459
460460 // Don't accept delete events for most shadow blocks.
461+ const block = this . _blocks [ e . blockId ] ;
461462 if (
462463 ! e . isFromExpandable &&
463- ( this . _blocks [ e . blockId ] . shadow && ! this . _blocks [ e . blockId ] . opcode . startsWith ( "argument_reporter_" ) )
464+ ( block . shadow && ! block . opcode . startsWith ( "argument_reporter_" ) )
464465 ) {
465466 return ;
466467 }
467468 // If this block is the initial block of a script, inform any runtime to forget about glows
468469 // as well as force end the script (if in compiler)
469- if ( this . _blocks [ e . blockId ] . topLevel ) {
470+ if ( block . topLevel ) {
470471 this . runtime . quietGlow ( e . blockId ) ;
471472 if ( this . runtime . compilerOptions . enabled ) setTimeout ( ( ) => {
472473 // slighlty delay script end to handle tab switching vs real block deletion
@@ -476,7 +477,7 @@ class Blocks {
476477 }
477478 } , 100 ) ;
478479 }
479- this . deleteBlock ( e . blockId ) ;
480+ this . deleteBlock ( e . blockId , e . isFromExpandable || block . opcode . startsWith ( "argument_reporter_" ) ) ;
480481 break ;
481482 case 'var_create' :
482483 this . resetCache ( ) ; // tw: more aggressive cache resetting
You can’t perform that action at this time.
0 commit comments