fix always cleared cache

This commit is contained in:
martin-mfg
2026-01-07 11:36:05 +01:00
parent 2e12a51ffc
commit 7859e66078
2 changed files with 8 additions and 5 deletions
+1 -5
View File
@@ -9,7 +9,7 @@ import 'react-loading-skeleton/dist/skeleton.css';
import { createMockReq, createMockRes } from '../../mock-http';
import { default as router } from '../../backend/.vercel/output/functions/api.func/router.js';
import { clearAxiosCache, setShouldMock } from '../../axios-override';
import { setShouldMock } from '../../axios-override';
import {
useIsAuthenticated,
useUserToken,
@@ -29,10 +29,6 @@ const SvgInline = (props) => {
setShouldMock(stage === 0 || !isAuthenticated);
}, [isAuthenticated, props.stage]);
useEffect(() => {
clearAxiosCache();
}, [userToken]);
useEffect(() => {
let isCurrent = true;
@@ -13,9 +13,11 @@ import { getUserMetadata } from '../../api';
import {
useIsAuthenticated,
useUserKey,
useUserToken,
} from '../../redux/selectors/userSelectors';
import { toast, ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import { clearAxiosCache } from '../../axios-override';
function App() {
const toMessage = (input) => {
@@ -48,6 +50,11 @@ function App() {
showError(event);
});
const userToken = useUserToken();
useEffect(() => {
clearAxiosCache();
}, [userToken]);
const userKey = useUserKey();
const isAuthenticated = useIsAuthenticated();
const [stage, setStage] = useState(isAuthenticated ? 1 : 0);