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 87a9fdf commit cd09e97
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/frontend/src/api/useDialogByIdSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ 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] });
void queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.DIALOGS] });
}
} catch (e) {
console.error('Error parsing event data:', e);
Expand Down

0 comments on commit cd09e97

Please sign in to comment.