Skip to content

Commit

Permalink
:fix: active_canvas maybe null
Browse files Browse the repository at this point in the history
  • Loading branch information
zhzLuke96 committed May 26, 2024
1 parent 426ac37 commit 8b610b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/widgets/DOMWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,12 @@ export class DOMWidget implements IWidget {
}
const graph = node.graph;

const canvas = LGraphCanvas.active_canvas;
const { $el: element } = this;

const hidden =
node.flags?.collapsed ||
(!!this.options?.hideOnZoom && canvas.ds.scale < 0.5) ||
(!!this.options?.hideOnZoom &&
LGraphCanvas.active_canvas?.ds.scale < 0.5) ||
this.computedHeight <= 0;
element.hidden = hidden;
element.style.display = hidden ? "none" : null;
Expand Down

0 comments on commit 8b610b8

Please sign in to comment.