Force history refresh

This commit is contained in:
Paulo Gustavo Veiga 2022-10-05 20:50:41 -07:00
parent 79cd5c55b1
commit 11a93dd7aa

View File

@ -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<unknown, ErrorInfo, ChangeHistory[]>(`history-${mapId}`, () => {
const { data } = useQuery<unknown, ErrorInfo, ChangeHistory[]>(
`history-${mapId}`,
() => {
return client.fetchHistory(mapId);
});
},
{
cacheTime: 0, // Force reload...
},
);
const changeHistory: ChangeHistory[] = data ? data : [];
const handleOnClose = (): void => {