From 22217899b50bc1af1edce3f4a744527a99841625 Mon Sep 17 00:00:00 2001 From: Ivan <8611739+IRBorisov@users.noreply.github.com> Date: Thu, 20 Feb 2025 18:02:04 +0300 Subject: [PATCH] M: Remove modficiation tracking --- .../pages/OssPage/EditorOssGraph/OssFlow.tsx | 19 ++----------------- .../EditorOssGraph/ToolbarOssGraph.tsx | 4 +--- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/rsconcept/frontend/src/features/oss/pages/OssPage/EditorOssGraph/OssFlow.tsx b/rsconcept/frontend/src/features/oss/pages/OssPage/EditorOssGraph/OssFlow.tsx index 8262a41e..a812859c 100644 --- a/rsconcept/frontend/src/features/oss/pages/OssPage/EditorOssGraph/OssFlow.tsx +++ b/rsconcept/frontend/src/features/oss/pages/OssPage/EditorOssGraph/OssFlow.tsx @@ -7,7 +7,6 @@ import { getNodesBounds, getViewportForBounds, Node, - NodeChange, ReactFlow, useEdgesState, useNodesState, @@ -22,7 +21,6 @@ import { useLibrary } from '@/features/library'; import { Overlay } from '@/components/Container'; import { CProps } from '@/components/props'; import { useMainHeight } from '@/stores/appLayout'; -import { useModificationStore } from '@/stores/modification'; import { useTooltipsStore } from '@/stores/tooltips'; import { APP_COLORS } from '@/styling/colors'; import { PARAMETER } from '@/utils/constants'; @@ -61,7 +59,6 @@ export function OssFlow() { const router = useConceptNavigation(); const { items: libraryItems } = useLibrary(); const flow = useReactFlow(); - const { setIsModified } = useModificationStore(); const isProcessing = useMutatingOss(); @@ -116,11 +113,7 @@ export function OssFlow() { : 'left' })) ); - - setTimeout(() => { - setIsModified(false); - }, PARAMETER.graphRefreshDelay); - }, [schema, setNodes, setEdges, setIsModified, toggleReset, edgeStraight, edgeAnimate]); + }, [schema, setNodes, setEdges, toggleReset, edgeStraight, edgeAnimate]); function getPositions() { return nodes.map(node => ({ @@ -130,13 +123,6 @@ export function OssFlow() { })); } - function handleNodesChange(changes: NodeChange[]) { - if (isMutable && changes.some(change => change.type === 'position' && change.position)) { - setIsModified(true); - } - onNodesChange(changes); - } - function handleSavePositions() { const positions = getPositions(); void updatePositions({ itemID: schema.id, positions: positions }).then(() => { @@ -147,7 +133,6 @@ export function OssFlow() { operation.position_y = item.position_y; } }); - setIsModified(false); }); } @@ -341,7 +326,7 @@ export function OssFlow() { } - disabled={isProcessing || !isModified} + disabled={isProcessing} onClick={onSavePositions} />