mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
Fix custom widget drawWidget never called (#1068)
This commit is contained in:
@@ -59,6 +59,8 @@ export function toConcreteWidget<TWidget extends IWidget | IBaseWidget>(
|
|||||||
node: LGraphNode,
|
node: LGraphNode,
|
||||||
wrapLegacyWidgets = true,
|
wrapLegacyWidgets = true,
|
||||||
): WidgetTypeMap[TWidget["type"]] | undefined {
|
): WidgetTypeMap[TWidget["type"]] | undefined {
|
||||||
|
if (widget instanceof BaseWidget) return widget
|
||||||
|
|
||||||
// Assertion: TypeScript has no concept of "all strings except X"
|
// Assertion: TypeScript has no concept of "all strings except X"
|
||||||
type RemoveBaseWidgetType<T> = T extends { type: TWidgetType } ? T : never
|
type RemoveBaseWidgetType<T> = T extends { type: TWidgetType } ? T : never
|
||||||
const narrowedWidget = widget as RemoveBaseWidgetType<TWidget>
|
const narrowedWidget = widget as RemoveBaseWidgetType<TWidget>
|
||||||
|
|||||||
Reference in New Issue
Block a user