fix(ui): incorrect node data used during update

This commit is contained in:
psychedelicious
2025-02-07 15:02:15 +11:00
parent 269f718d2c
commit 85f5bb4a02
2 changed files with 5 additions and 3 deletions

View File

@@ -34,7 +34,9 @@ const getMayUpdateNode = (node: InvocationNode, template: InvocationTemplate): b
* - Create a new node data object with the latest version of the template.
* - Recursively merge new node data object into the node to be updated.
*
* @param node The node to updated.
* The input node is not mutated; a new object is returned.
*
* @param node The node to be updated.
* @param template The invocation template to update to.
* @throws {NodeUpdateError} If the node is not an invocation node.
*/

View File

@@ -71,7 +71,7 @@ export const validateWorkflow = async (
const { nodes, edges } = _workflow;
const warnings: WorkflowWarning[] = [];
for (const [i, node] of nodes.entries()) {
for (const node of nodes) {
if (!isWorkflowInvocationNode(node)) {
// We don't need to validate Note nodes or CurrentImage nodes - only Invocation nodes
continue;
@@ -94,7 +94,7 @@ export const validateWorkflow = async (
if (getNeedsUpdate(node.data, template)) {
try {
const updatedNode = updateNode(node, template);
nodes[i] = updatedNode;
node.data = updatedNode.data;
} catch (e) {
const message = t('nodes.unableToUpdateNode', {
node: node.id,