diff --git a/frontend/src/components/visual-editor/v2/Diagrams.tsx b/frontend/src/components/visual-editor/v2/Diagrams.tsx index d8083d4..bdb0e8a 100644 --- a/frontend/src/components/visual-editor/v2/Diagrams.tsx +++ b/frontend/src/components/visual-editor/v2/Diagrams.tsx @@ -475,12 +475,14 @@ const Diagrams = () => { queryClient.removeQueries({ predicate: ({ queryKey }) => { - const [qType, qEntity] = queryKey; + const [qType, qEntity, qId] = queryKey; return ( (qType === QueryType.collection && - isSameEntity(qEntity, EntityType.BLOCK)) || - isSameEntity(qEntity, EntityType.CATEGORY) + isSameEntity(qEntity, EntityType.BLOCK) && + qId === selectedCategoryId) || + (isSameEntity(qEntity, EntityType.CATEGORY) && + qId === selectedCategoryId) ); }, });