[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

@@ -36,6 +36,7 @@ const ext = {
w.type === 'combo' && w.options.values?.length === values.length
)
.find((w) =>
// @ts-ignore Poorly typed; filter above "should" mitigate exceptions
w.options.values?.every((v, i) => v === values[i])
)?.value

View File

@@ -139,6 +139,7 @@ useExtensionService().registerExtension({
if (uploadPath && modelWidget) {
if (!modelWidget.options?.values?.includes(uploadPath)) {
// @ts-ignore Fails due to earlier type-assertion of IStringWidget
modelWidget.options?.values?.push(uploadPath)
}
@@ -296,6 +297,7 @@ useExtensionService().registerExtension({
if (uploadPath && modelWidget) {
if (!modelWidget.options?.values?.includes(uploadPath)) {
// @ts-ignore Fails due to earlier type-assertion of IStringWidget
modelWidget.options?.values?.push(uploadPath)
}