From 11a93dd7aa356c05b2ea5796c6319efd2a50f997 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 5 Oct 2022 20:50:41 -0700 Subject: [PATCH] Force history refresh --- .../action-dispatcher/history-dialog/index.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 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 4db4eb89..5c85a700 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 @@ -22,9 +22,16 @@ const HistoryDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElemen const intl = useIntl(); const queryClient = useQueryClient(); const client: Client = useSelector(activeInstance); - const { data } = useQuery(`history-${mapId}`, () => { - return client.fetchHistory(mapId); - }); + const { data } = useQuery( + `history-${mapId}`, + () => { + return client.fetchHistory(mapId); + }, + { + cacheTime: 0, // Force reload... + }, + ); + const changeHistory: ChangeHistory[] = data ? data : []; const handleOnClose = (): void => {