Skip to content

Commit

Permalink
Update store.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoenig committed Aug 8, 2024
1 parent 82ae6e6 commit c129d28
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,9 @@ SnapSerializer.prototype.loadCustomizedPrimitives = function (
child.childNamed('scripts')
);

console.log('customizing prim', definition.selector)
if (stage) { // update all instances
console.log(' ...updating stage blocks...')
stage.allBlockInstances(definition).reverse().forEach(
block => block.refresh()
);
Expand All @@ -1264,8 +1266,10 @@ SnapSerializer.prototype.loadCustomizedPrimitives = function (
}
);
} else { // at least update instances found in customized prims
console.log(' ...no stage, updating customized prim', definition.selector)
SpriteMorph.prototype.everyBlock().forEach(block => {
if (block.definition === definition) {
console.log(' ...updating', block)
block.refresh();
}
});
Expand Down

0 comments on commit c129d28

Please sign in to comment.