mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 15:10:06 +00:00
[Refactor] Generate DOM widget id in constructor (#3508)
This commit is contained in:
@@ -103,7 +103,6 @@ abstract class BaseDOMWidgetImpl<V extends object | string>
|
||||
readonly node: LGraphNode
|
||||
|
||||
constructor(obj: {
|
||||
id: string
|
||||
node: LGraphNode
|
||||
name: string
|
||||
type: string
|
||||
@@ -114,7 +113,7 @@ abstract class BaseDOMWidgetImpl<V extends object | string>
|
||||
this.name = obj.name
|
||||
this.options = obj.options
|
||||
|
||||
this.id = obj.id
|
||||
this.id = generateUUID()
|
||||
this.node = obj.node
|
||||
}
|
||||
|
||||
@@ -172,7 +171,6 @@ export class DOMWidgetImpl<T extends HTMLElement, V extends object | string>
|
||||
readonly element: T
|
||||
|
||||
constructor(obj: {
|
||||
id: string
|
||||
node: LGraphNode
|
||||
name: string
|
||||
type: string
|
||||
@@ -235,7 +233,6 @@ export class ComponentWidgetImpl<V extends object | string>
|
||||
readonly inputSpec: InputSpec
|
||||
|
||||
constructor(obj: {
|
||||
id: string
|
||||
node: LGraphNode
|
||||
name: string
|
||||
component: Component
|
||||
@@ -293,7 +290,6 @@ LGraphNode.prototype.addDOMWidget = function <
|
||||
options: DOMWidgetOptions<V> = {}
|
||||
): DOMWidget<T, V> {
|
||||
const widget = new DOMWidgetImpl({
|
||||
id: generateUUID(),
|
||||
node: this,
|
||||
name,
|
||||
type,
|
||||
|
||||
Reference in New Issue
Block a user