From d23658d1d64cd4faf99d7e656e5b8f44f181cab0 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Wed, 29 Jan 2025 17:34:39 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20auto=20gen=20groups=20not?= =?UTF-8?q?=20instantly=20updating?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/features/graph/components/edges/DrawingEdge.tsx | 4 +++- .../src/features/graph/components/nodes/group/GroupNode.tsx | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/builder/src/features/graph/components/edges/DrawingEdge.tsx b/apps/builder/src/features/graph/components/edges/DrawingEdge.tsx index c13a865c0..09c34b8df 100644 --- a/apps/builder/src/features/graph/components/edges/DrawingEdge.tsx +++ b/apps/builder/src/features/graph/components/edges/DrawingEdge.tsx @@ -145,7 +145,9 @@ export const DrawingEdge = ({ connectingIds }: Props) => { credentialsId: workspace?.settings?.groupTitlesAutoGeneration ?.credentialsId as string, typebotId: typebot.id, - groupContent: JSON.stringify(group), + groupContent: JSON.stringify({ + blocks: group.blocks.map(({ id, outgoingEdgeId, ...rest }) => rest), + }), }); updateGroup(groupIndex, { title: result.title }); diff --git a/apps/builder/src/features/graph/components/nodes/group/GroupNode.tsx b/apps/builder/src/features/graph/components/nodes/group/GroupNode.tsx index 263c5e88d..36d7f2259 100644 --- a/apps/builder/src/features/graph/components/nodes/group/GroupNode.tsx +++ b/apps/builder/src/features/graph/components/nodes/group/GroupNode.tsx @@ -87,6 +87,10 @@ export const GroupNode = ({ group, groupIndex }: Props) => { ); }, [connectingIds, group.id]); + useEffect(() => { + if (group.title !== groupTitle) setGroupTitle(group.title); + }, [group.title]); + const handleTitleSubmit = (title: string) => updateGroup(groupIndex, { title });