Reset cache in variable create, delete

This commit is contained in:
Thomas Weber committed 2020-07-26 15:30:00 -05:00
1 parent f9bc2137c5
commit a7ae8ccabc
1 file changed
+2
+2
View File
@@ -401,6 +401,7 @@ class Blocks {
this.deleteBlock(e.blockId);
break;
case 'var_create':
this.resetCache(); // tw: more aggressive cache resetting
// Check if the variable being created is global or local
// If local, create a local var on the current editing target, as long
// as there are no conflicts, and the current target is actually a sprite
@@ -449,6 +450,7 @@ class Blocks {
this.emitProjectChanged();
break;
case 'var_delete': {
this.resetCache(); // tw: more aggressive cache resetting
const target = (editingTarget && editingTarget.variables.hasOwnProperty(e.varId)) ?
editingTarget : stage;
target.deleteVariable(e.varId);