From 7c151b34412ca644f954409ab99de78fdf879646 Mon Sep 17 00:00:00 2001 From: Wesley Finck Date: Wed, 15 Apr 2026 18:24:15 -0700 Subject: [PATCH] invalidate card and collection query on collection create success --- .../connections/lib/mutations/useCreateConnection.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/webapp/features/connections/lib/mutations/useCreateConnection.tsx b/src/webapp/features/connections/lib/mutations/useCreateConnection.tsx index 0d3970a6..9dcc0637 100644 --- a/src/webapp/features/connections/lib/mutations/useCreateConnection.tsx +++ b/src/webapp/features/connections/lib/mutations/useCreateConnection.tsx @@ -5,6 +5,7 @@ import { ConnectionType } from '@semble/types'; import { cardKeys } from '@/features/cards/lib/cardKeys'; import { feedKeys } from '@/features/feeds/lib/feedKeys'; import { profileKeys } from '@/features/profile/lib/profileKeys'; +import { collectionKeys } from '@/features/collections/lib/collectionKeys'; export default function useCreateConnection() { const queryClient = useQueryClient(); @@ -24,6 +25,10 @@ export default function useCreateConnection() { queryClient.invalidateQueries({ queryKey: connectionKeys.all() }); // Invalidate all feed queries so the new connection appears in feeds queryClient.invalidateQueries({ queryKey: feedKeys.all() }); + // Invalidate all card queries so connection count updates everywhere + queryClient.invalidateQueries({ queryKey: cardKeys.all() }); + // Invalidate all collection queries so connection count updates in collection views + queryClient.invalidateQueries({ queryKey: collectionKeys.all() }); // Invalidate forward connections for source URL queryClient.invalidateQueries({ -- knotmirror 0.0.1