Fix custom widget drawWidget never called (#1068)

This commit is contained in:
filtered
2025-05-28 10:12:13 +10:00
committed by GitHub
parent 0d5fd0e90d
commit 273eae1e8d

View File

@@ -59,6 +59,8 @@ export function toConcreteWidget<TWidget extends IWidget | IBaseWidget>(
node: LGraphNode,
wrapLegacyWidgets = true,
): WidgetTypeMap[TWidget["type"]] | undefined {
if (widget instanceof BaseWidget) return widget
// Assertion: TypeScript has no concept of "all strings except X"
type RemoveBaseWidgetType<T> = T extends { type: TWidgetType } ? T : never
const narrowedWidget = widget as RemoveBaseWidgetType<TWidget>