Make sure arrays potential_output_nodes and potential_outputs have the same length to avoid undefined bug when sharing

This commit is contained in:
johnqiao
2023-11-25 00:54:20 -07:00
parent ab257ed750
commit 3dc35c0498
2 changed files with 11 additions and 13 deletions

View File

@@ -526,7 +526,7 @@ export class OpenArtShareDialog extends ComfyDialog {
// order as `potential_output_nodes`.
const potential_output_to_order = {};
potential_output_nodes.forEach((node, index) => {
potential_output_to_order[node.id] =[node, potential_outputs[index]];
potential_output_to_order[node.id] = [node, potential_outputs[index]];
})
// Sort the object `potential_output_to_order` by key (node ID)
const sorted_potential_output_to_order = Object.fromEntries(
@@ -539,7 +539,7 @@ export class OpenArtShareDialog extends ComfyDialog {
sorted_potential_outputs.push(value[1]);
}
potential_output_nodes = sorted_potential_output_nodes;
potential_outputs = sorted_potential_outputs.filter((output) => !!output);
potential_outputs = sorted_potential_outputs;
this.message.innerHTML = "";
this.message.textContent = "";