mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-01 20:15:07 -05:00
fix(ui): incorrect node data used during update
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user