Merge pull request #30 from DDibyajyot/fix/edit-remove-buttons

fix: [BUG] #25 -Edit & Remove Buttons stay active after category switch
This commit is contained in:
Mohamed Marrouchi 2024-09-18 07:25:18 +01:00 committed by GitHub
commit fb427effaa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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";
@ -141,6 +140,7 @@ const Diagrams = () => {
if (id) { if (id) {
setSelectedCategoryId?.(id); setSelectedCategoryId?.(id);
setSelectedBlockId(undefined); // Reset selected block when switching categories, resetting edit & remove buttons
} }
} }
}; };