mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 10:42:44 +00:00
Workaround crash on load from custom nodes (#1023)
This commit is contained in:
@@ -75,7 +75,12 @@ export abstract class BaseWidget<TWidget extends IWidget = IWidget> implements I
|
|||||||
onPointerDown?(pointer: CanvasPointer, node: LGraphNode, canvas: LGraphCanvas): boolean
|
onPointerDown?(pointer: CanvasPointer, node: LGraphNode, canvas: LGraphCanvas): boolean
|
||||||
|
|
||||||
constructor(widget: TWidget) {
|
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.name = widget.name
|
||||||
this.options = widget.options
|
this.options = widget.options
|
||||||
this.type = widget.type
|
this.type = widget.type
|
||||||
|
|||||||
Reference in New Issue
Block a user