mirror of
https://github.com/hexastack/hexabot
synced 2024-11-24 13:05:15 +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 { BlockPorts } from "@/types/visual-editor.types";
|
||||
|
||||
|
||||
import BlockDialog from "../BlockDialog";
|
||||
import { ZOOM_LEVEL } from "../constants";
|
||||
import { useVisualEditor } from "../hooks/useVisualEditor";
|
||||
@ -273,7 +272,13 @@ const Diagrams = () => {
|
||||
zoomUpdated: debouncedZoomEvent,
|
||||
offsetUpdated: debouncedOffsetEvent,
|
||||
});
|
||||
}, [JSON.stringify(blocks)]);
|
||||
}, [
|
||||
JSON.stringify(
|
||||
blocks.map((b) => {
|
||||
return { ...b, position: undefined, updatedAt: undefined };
|
||||
}),
|
||||
),
|
||||
]);
|
||||
|
||||
const handleDeleteButton = () => {
|
||||
const selectedEntities = engine?.getModel().getSelectedEntities();
|
||||
|
Loading…
Reference in New Issue
Block a user