fix: extra options form enum list for some node

This commit is contained in:
bennykok
2025-04-16 17:09:51 +08:00
parent 22858abb31
commit fe2d9b82b5
+5 -3
View File
@@ -215,7 +215,7 @@ function getWidgetType(config) {
async function convertToInput(node, widget, config) {
const { type } = getWidgetType(config);
console.log(config);
console.log(node, widget, config);
const result = await app.extensionManager.dialog.prompt(
{
@@ -322,10 +322,13 @@ async function convertToInput(node, widget, config) {
// inputNode = LiteGraph.createNode(externalNode, "External Input: " + inputId);
// }
var options;
const index = node.inputs.findIndex((x) => x.name == widget.name);
if (type === "COMBO") {
options = widget.options?.values ?? config[0];
inputNode.configure({
widgets_values: [inputId, widget.value, JSON.stringify(config[0])],
widgets_values: [inputId, widget.value, JSON.stringify(options)],
});
} else
{
@@ -339,7 +342,6 @@ async function convertToInput(node, widget, config) {
if (type === "COMBO") {
console.log(inputNode);
const options = config[0];
console.log(options);
inputNode.widgets.find((x) => x.name == "default_value").options.values = options;
}