Skip to content

Commit

Permalink
fix: πŸ› debug node
Browse files Browse the repository at this point in the history
wouldn't work when run twice since the past fix...
  • Loading branch information
melMass committed Oct 5, 2023
1 parent 125a28f commit 01c2b02
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions web/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,14 @@ app.registerExtension({
// const pos = this.widgets.findIndex((w) => w.name === "anything_1");
// if (pos !== -1) {
for (let i = 0; i < this.widgets.length; i++) {
this.widgets[i].onRemoved?.()
if (this.widgets[i].name !== 'output_to_console') {
this.widgets[i].onRemoved?.()
}
}
this.widgets.length = 0
this.widgets.length = 1
}
let widgetI = 1

if (message.text) {
for (const txt of message.text) {
const w = this.addCustomWidget(
Expand Down Expand Up @@ -121,6 +124,7 @@ app.registerExtension({
if (this.widgets[y].canvas) {
this.widgets[y].canvas.remove()
}
shared.cleanupNode(this)
this.widgets[y].onRemoved?.()
}
}
Expand Down

0 comments on commit 01c2b02

Please sign in to comment.