fix: update mutate template to preserve minimized outputs (#8069)
Updated mutate-template to preserve hidden outputs
This commit is contained in:
parent
71efcdd099
commit
27f9ac243b
1 changed files with 5 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import {
|
||||||
import { APIClassType, ResponseErrorDetailAPI } from "@/types/api";
|
import { APIClassType, ResponseErrorDetailAPI } from "@/types/api";
|
||||||
import { UseMutationResult } from "@tanstack/react-query";
|
import { UseMutationResult } from "@tanstack/react-query";
|
||||||
import { cloneDeep, debounce } from "lodash";
|
import { cloneDeep, debounce } from "lodash";
|
||||||
|
import { updateHiddenOutputs } from "./update-hidden-outputs";
|
||||||
|
|
||||||
// Map to store debounced functions for each node ID
|
// Map to store debounced functions for each node ID
|
||||||
const debouncedFunctions = new Map<string, ReturnType<typeof debounce>>();
|
const debouncedFunctions = new Map<string, ReturnType<typeof debounce>>();
|
||||||
|
|
@ -53,7 +54,10 @@ export const mutateTemplate = async (
|
||||||
});
|
});
|
||||||
if (newTemplate) {
|
if (newTemplate) {
|
||||||
newNode.template = newTemplate.template;
|
newNode.template = newTemplate.template;
|
||||||
newNode.outputs = newTemplate.outputs;
|
newNode.outputs = updateHiddenOutputs(
|
||||||
|
newNode.outputs ?? [],
|
||||||
|
newTemplate.outputs ?? [],
|
||||||
|
);
|
||||||
newNode.tool_mode = toolMode ?? node.tool_mode;
|
newNode.tool_mode = toolMode ?? node.tool_mode;
|
||||||
}
|
}
|
||||||
setNodeClass(newNode);
|
setNodeClass(newNode);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue