mirror of https://github.com/portainer/portainer
fix(react-query): set react-query networkMode to offlineFirst EE-7081 (#11812)
parent
db8f9c6f6c
commit
2669a44d79
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue