From 89ce9f2a60489c638583a40b6969bf38652257d2 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 7 Apr 2022 14:32:39 -0300 Subject: [PATCH] Fix handler resolution issue. --- .../maps-page/action-dispatcher/history-dialog/index.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/history-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/history-dialog/index.tsx index dfbd4540..d95fa1c1 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/history-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/history-dialog/index.tsx @@ -20,7 +20,7 @@ import Paper from '@mui/material/Paper'; const HistoryDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElement => { const intl = useIntl(); - + const queryClient = useQueryClient(); const client: Client = useSelector(activeInstance); const { data } = useQuery(`history-${mapId}`, () => { return client.fetchHistory(mapId); @@ -28,11 +28,8 @@ const HistoryDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElemen const changeHistory: ChangeHistory[] = data ? data : []; const handleOnClose = (): void => { - onClose(); - - // Invalidate cache ... - const queryClient = useQueryClient(); queryClient.invalidateQueries(`history-${mapId}`); + onClose(); }; const handleOnClick = (event, vid: number): void => {