fix auto refresh (disable cache)

This commit is contained in:
proddy
2025-03-04 20:24:55 +01:00
parent 4991e2b7cd
commit 5227fafa1b

View File

@@ -9,7 +9,7 @@ export const ACCESS_TOKEN = 'access_token';
export const alovaInstance = createAlova({ export const alovaInstance = createAlova({
statesHook: ReactHook, statesHook: ReactHook,
// timeout: 3000, // 3 seconds before throwing a timeout error, default is 0 = none // timeout: 3000, // 3 seconds before throwing a timeout error, default is 0 = none
// cacheFor: null, // disable cache cacheFor: null, // disable cache
// cacheFor: { // cacheFor: {
// GET: { // GET: {
// mode: 'memory', // mode: 'memory',
@@ -22,7 +22,7 @@ export const alovaInstance = createAlova({
method.config.headers.Authorization = method.config.headers.Authorization =
'Bearer ' + localStorage.getItem(ACCESS_TOKEN); 'Bearer ' + localStorage.getItem(ACCESS_TOKEN);
} }
// for simulating vrey slow networks // for simulating very slow networks
// return new Promise((resolve) => { // return new Promise((resolve) => {
// const random = 3000 + Math.random() * 2000; // const random = 3000 + Math.random() * 2000;
// setTimeout(resolve, Math.floor(random)); // setTimeout(resolve, Math.floor(random));