fix: disable retry on mount by default
This commit is contained in:
@@ -4,12 +4,12 @@ import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
|||||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||||
|
|
||||||
import api from 'helpers/api.js';
|
import api from 'helpers/api.js';
|
||||||
import useAuthentication from 'hooks/useAuthentication.js';
|
|
||||||
|
|
||||||
const queryClient = new QueryClient({
|
const queryClient = new QueryClient({
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
queries: {
|
queries: {
|
||||||
staleTime: 1000,
|
staleTime: 1000,
|
||||||
|
retryOnMount: false,
|
||||||
refetchOnWindowFocus: false,
|
refetchOnWindowFocus: false,
|
||||||
// provides a convenient default while it should be overridden for other HTTP methods
|
// provides a convenient default while it should be overridden for other HTTP methods
|
||||||
queryFn: async ({ queryKey, signal }) => {
|
queryFn: async ({ queryKey, signal }) => {
|
||||||
|
@@ -8,6 +8,7 @@ export default function useAutomatischConfig() {
|
|||||||
const { data } = await api.get(`/v1/automatisch/config`, {
|
const { data } = await api.get(`/v1/automatisch/config`, {
|
||||||
signal,
|
signal,
|
||||||
});
|
});
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user