🐛 Fix auto gen groups not instantly updating

This commit is contained in:
Baptiste Arnaud 2025-01-29 17:34:39 +01:00
parent 57f7228c0f
commit d23658d1d6
No known key found for this signature in database
2 changed files with 7 additions and 1 deletions

View File

@ -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 });

View File

@ -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 });