Skip to content

Commit

Permalink
fix: refetch data after gui action delete
Browse files Browse the repository at this point in the history
  • Loading branch information
mbacherycz committed Feb 24, 2025
1 parent 0ec966a commit 33fe75f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/frontend/src/api/useDialogByIdSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const useDialogByIdSubscription = (dialogId: string | undefined, dialogTo
const updatedType: DialogEventType | undefined = jsonPayload.data?.dialogEvents?.type;
if (updatedType && updatedType === DialogEventType.DialogDeleted) {
// Redirect to inbox if the dialog was deleted
void queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.DIALOG_BY_ID] });
navigate(PageRoutes.inbox);
} else if (updatedType && updatedType === DialogEventType.DialogUpdated) {
void queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.DIALOG_BY_ID] });
Expand Down

0 comments on commit 33fe75f

Please sign in to comment.