From ab87534001d82715f3cb0d282c972724a7a3a398 Mon Sep 17 00:00:00 2001 From: Mateusz Bacherycz Date: Mon, 24 Feb 2025 15:22:56 +0100 Subject: [PATCH] fix: refetch data after gui action delete --- packages/frontend/src/api/useDialogByIdSubscription.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/frontend/src/api/useDialogByIdSubscription.ts b/packages/frontend/src/api/useDialogByIdSubscription.ts index bd925bccf..03f67b87c 100644 --- a/packages/frontend/src/api/useDialogByIdSubscription.ts +++ b/packages/frontend/src/api/useDialogByIdSubscription.ts @@ -29,6 +29,7 @@ export const useDialogByIdSubscription = (dialogId: string | undefined, dialogTo if (updatedType && updatedType === DialogEventType.DialogDeleted) { // Redirect to inbox if the dialog was deleted navigate(PageRoutes.inbox); + void queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.DIALOGS] }); } else if (updatedType && updatedType === DialogEventType.DialogUpdated) { void queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.DIALOG_BY_ID] }); }