mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-22 15:54:09 +00:00
merge main into rh-test
This commit is contained in:
@@ -55,7 +55,7 @@ export interface DOMWidget<T extends HTMLElement, V extends object | string>
|
||||
* - widget: Reference to the widget instance
|
||||
* - onUpdate:modelValue: The update handler for v-model
|
||||
*/
|
||||
export type ComponentWidgetCustomProps = Record<string, unknown>
|
||||
type ComponentWidgetCustomProps = Record<string, unknown>
|
||||
|
||||
/**
|
||||
* Standard props that are handled separately by DomWidget.vue and should be
|
||||
@@ -375,17 +375,3 @@ LGraphNode.prototype.addDOMWidget = function <
|
||||
|
||||
return widget
|
||||
}
|
||||
|
||||
/**
|
||||
* Prunes widgets that are no longer in the graph.
|
||||
* @param nodes The nodes to prune widgets for.
|
||||
*/
|
||||
export const pruneWidgets = (nodes: LGraphNode[]) => {
|
||||
const nodeSet = new Set(nodes)
|
||||
const domWidgetStore = useDomWidgetStore()
|
||||
for (const { widget } of domWidgetStore.widgetStates.values()) {
|
||||
if (!nodeSet.has(widget.node)) {
|
||||
domWidgetStore.unregisterWidget(widget.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user