mirror of
https://github.com/hexastack/hexabot
synced 2025-04-27 01:39:59 +00:00
fix: remove extra rerendering when position changes
This commit is contained in:
parent
a9838efda5
commit
7495dfef2a
@ -48,7 +48,6 @@ import { IBlock } from "@/types/block.types";
|
|||||||
import { ICategory } from "@/types/category.types";
|
import { ICategory } from "@/types/category.types";
|
||||||
import { BlockPorts } from "@/types/visual-editor.types";
|
import { BlockPorts } from "@/types/visual-editor.types";
|
||||||
|
|
||||||
|
|
||||||
import BlockDialog from "../BlockDialog";
|
import BlockDialog from "../BlockDialog";
|
||||||
import { ZOOM_LEVEL } from "../constants";
|
import { ZOOM_LEVEL } from "../constants";
|
||||||
import { useVisualEditor } from "../hooks/useVisualEditor";
|
import { useVisualEditor } from "../hooks/useVisualEditor";
|
||||||
@ -273,7 +272,13 @@ const Diagrams = () => {
|
|||||||
zoomUpdated: debouncedZoomEvent,
|
zoomUpdated: debouncedZoomEvent,
|
||||||
offsetUpdated: debouncedOffsetEvent,
|
offsetUpdated: debouncedOffsetEvent,
|
||||||
});
|
});
|
||||||
}, [JSON.stringify(blocks)]);
|
}, [
|
||||||
|
JSON.stringify(
|
||||||
|
blocks.map((b) => {
|
||||||
|
return { ...b, position: undefined, updatedAt: undefined };
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
|
||||||
const handleDeleteButton = () => {
|
const handleDeleteButton = () => {
|
||||||
const selectedEntities = engine?.getModel().getSelectedEntities();
|
const selectedEntities = engine?.getModel().getSelectedEntities();
|
||||||
|
Loading…
Reference in New Issue
Block a user