[Refactor] Update Litegraph widget types / cleanup (#3782)

This commit is contained in:
filtered
2025-05-06 19:40:30 +10:00
committed by GitHub
parent 6a3cf9e698
commit 0da6be5cdc
6 changed files with 20 additions and 6 deletions

View File

@@ -35,7 +35,11 @@ export function isAudioNode(node: LGraphNode | undefined): boolean {
export function addToComboValues(widget: IComboWidget, value: string) {
if (!widget.options) widget.options = { values: [] }
if (!widget.options.values) widget.options.values = []
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore Combo widget values may be a dictionary or legacy function type
if (!widget.options.values.includes(value)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore Combo widget values may be a dictionary or legacy function type
widget.options.values.push(value)
}
}