From 996a504caabd5df7c13bf8ba3018c7a604d3b737 Mon Sep 17 00:00:00 2001 From: hexastack Date: Mon, 28 Oct 2024 08:29:53 +0100 Subject: [PATCH] fix: remove join/split --- .../src/components/visual-editor/v2/Diagrams.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/visual-editor/v2/Diagrams.tsx b/frontend/src/components/visual-editor/v2/Diagrams.tsx index 43957fd..e8f83ae 100644 --- a/frontend/src/components/visual-editor/v2/Diagrams.tsx +++ b/frontend/src/components/visual-editor/v2/Diagrams.tsx @@ -69,7 +69,7 @@ const Diagrams = () => { const [canvas, setCanvas] = useState(); const [selectedBlockId, setSelectedBlockId] = useState(); const deleteDialogCtl = useDialog(false); - const moveDialogCtl = useDialog(false); + const moveDialogCtl = useDialog(false); const { refetch: refetchBlocks } = useFind( { entity: EntityType.BLOCK, format: Format.FULL }, { @@ -334,7 +334,7 @@ const Diagrams = () => { }; const handleMoveButton = () => { const selectedEntities = engine?.getModel().getSelectedEntities(); - const ids = selectedEntities?.map((model) => model.getID()).join(","); + const ids = selectedEntities?.map((model) => model.getID()); if (ids && selectedEntities) { moveDialogCtl.openDialog(ids); @@ -458,11 +458,9 @@ const Diagrams = () => { return; } - const id = moveDialogCtl?.data; - - if (id) { - const ids = id.includes(",") ? id.split(",") : [id]; + const ids = moveDialogCtl?.data; + if (ids) { for (const blockId of ids) { const block = getBlockFromCache(blockId); @@ -487,6 +485,8 @@ const Diagrams = () => { }, ); } + refetchBlocks(); + setSelectedCategoryId(newCategoryId); setSelectedBlockId(undefined); moveDialogCtl.closeDialog();