From fb24fdea92dd6fc1b86767aa18f4bc0c0abf0640 Mon Sep 17 00:00:00 2001 From: Suhaha Date: Mon, 15 Apr 2024 11:55:17 +0800 Subject: [PATCH] fix(ui): mutate form states after export --- ui/src/modules/app_builder/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/modules/app_builder/index.tsx b/ui/src/modules/app_builder/index.tsx index 8d9660d..7606931 100644 --- a/ui/src/modules/app_builder/index.tsx +++ b/ui/src/modules/app_builder/index.tsx @@ -23,7 +23,7 @@ import { GithubLogo } from '../../components/Layout/GithubLogo' import { PublishModal } from '../shared/PublishModal' import { BuilderCanvas } from './Canvas' import { SchemaProvider } from './useSchema' -import { Config, ConfigAndMetadataUI, MetadataUI } from './linguflow.type' +import { Config, ConfigAndMetadataUI, MetadataUI, Node } from './linguflow.type' import { ContainerElemProvider } from './Canvas/useContainerElem' import { TOOLBAR_HEIGHT, TOOLBAR_PANE_HEIGHT, Toolbar } from './Toolbar' import { getCurrentDateTimeName, useCreateVersion, useUpdateVersion } from './useMutateVersion' @@ -305,7 +305,7 @@ const BuilderMenu: React.FC<{ } const exportYAML = () => { - const nodes = Object.values(getValues()) + const nodes: Node[] = JSON.parse(JSON.stringify(Object.values(getValues()))) nodes.forEach((v: { [k: string]: any }) => sanitize(v)) const config: ConfigAndMetadataUI = {