Workaround crash on load from custom nodes (#1023)

This commit is contained in:
filtered
2025-05-07 21:18:42 +10:00
committed by GitHub
parent ccbdff0ad1
commit 86d1c2a93a

View File

@@ -75,7 +75,12 @@ export abstract class BaseWidget<TWidget extends IWidget = IWidget> implements I
onPointerDown?(pointer: CanvasPointer, node: LGraphNode, canvas: LGraphCanvas): boolean
constructor(widget: TWidget) {
Object.assign(this, widget)
// TODO: Resolve this workaround. Ref: https://github.com/Comfy-Org/litegraph.js/issues/1022
// @ts-expect-error Prevent naming conflicts with custom nodes.
// eslint-disable-next-line unused-imports/no-unused-vars
const { outline_color, background_color, height, text_color, secondary_text_color, disabledTextColor, displayName, displayValue, labelBaseline, ...safeValues } = widget
Object.assign(this, safeValues)
this.name = widget.name
this.options = widget.options
this.type = widget.type