Skip to content

Commit

Permalink
don't show extension icon in upvars
Browse files Browse the repository at this point in the history
I can't believe I never noticed this before.
  • Loading branch information
ego-lay-atman-bay committed Dec 13, 2024
1 parent 651b461 commit dd45656
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions scratch3/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -838,24 +838,29 @@ class BlockView {
// Avoid accidental mutation
this.info = { ...block.info }
if (
Object.prototype.hasOwnProperty.call(categoryAliases, this.info.category)
categoryAliases.hasOwnProperty(this.info.category)
) {
this.info.category = categoryAliases[this.info.category]
}
if (Object.prototype.hasOwnProperty.call(shapeAliases, this.info.shape)) {
if (shapeAliases.hasOwnProperty(this.info.shape)) {
this.info.shape = shapeAliases[this.info.shape]
}
console.log('upvar', this.info.category)
if (
Object.prototype.hasOwnProperty.call(extensions, this.info.category) ||
extensions.hasOwnProperty(this.info.category) ||
this.info.local
) {
this.children.unshift(new LineView())
if (!this.isUpvar) {
this.children.unshift(new LineView())
}
if (
Object.prototype.hasOwnProperty.call(extensions, this.info.category)
extensions.hasOwnProperty(this.info.category)
) {
this.children.unshift(
new IconView({ name: this.info.category + "Block" }),
)
if (!this.isUpvar) {
this.children.unshift(
new IconView({ name: this.info.category + "Block" }),
)
}
this.info.category = "extension"
}
if (this.info.local) {
Expand Down

0 comments on commit dd45656

Please sign in to comment.