1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 14:29:40 +02:00

fix(react-query): set react-query networkMode to offlineFirst EE-7081 (#11812)

This commit is contained in:
cmeng 2024-05-20 15:29:56 +12:00 committed by GitHub
parent db8f9c6f6c
commit 2669a44d79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -76,6 +76,11 @@ function mergeOptions<T>(options: T[]) {
export function createQueryClient() { export function createQueryClient() {
return new QueryClient({ return new QueryClient({
defaultOptions: {
queries: {
networkMode: 'offlineFirst',
},
},
mutationCache: new MutationCache({ mutationCache: new MutationCache({
onError: (error, variable, context, mutation) => { onError: (error, variable, context, mutation) => {
handleError(error, mutation.meta?.error); handleError(error, mutation.meta?.error);