From 850347296b011c9691dc6a7a98e248193b0abe26 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Fri, 17 Nov 2023 16:40:22 -0600 Subject: [PATCH] dms: fixing bad query key --- ui/src/state/chat/chat.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ui/src/state/chat/chat.ts b/ui/src/state/chat/chat.ts index e0fcbb3327..737c299436 100644 --- a/ui/src/state/chat/chat.ts +++ b/ui/src/state/chat/chat.ts @@ -1128,8 +1128,10 @@ export function useSendReplyMutation() { const infiniteQueryKey = ['dms', whom, 'infinite']; const parentWritQueryKey = ['dms', whom, parentId]; - queryClient.refetchQueries(parentWritQueryKey); - queryClient.invalidateQueries(infiniteQueryKey); + queryClient.invalidateQueries(parentWritQueryKey, { + refetchType: 'none', + }); + queryClient.invalidateQueries(infiniteQueryKey, { refetchType: 'none' }); }, }); } @@ -1448,10 +1450,7 @@ export function useHasUnreadMessages() { } export function useWrit(whom: string, writId: string, disabled = false) { - const queryKey = useMemo( - () => ['dms', whom, 'writs', writId], - [whom, writId] - ); + const queryKey = useMemo(() => ['dms', whom, writId], [whom, writId]); const scryPath = useMemo(() => { const suffix = `/writs/writ/id/${writId}`;