From 9a4aa004d2c4491b0af64b69fb5d05213fd43bfb Mon Sep 17 00:00:00 2001 From: hexastack Date: Fri, 1 Nov 2024 10:35:06 +0100 Subject: [PATCH] fix: predicate --- frontend/src/components/visual-editor/v2/Diagrams.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) ); }, });