diff --git a/src/frontend/src/contexts/authContext.tsx b/src/frontend/src/contexts/authContext.tsx index 256712303..f0c8ec1d6 100644 --- a/src/frontend/src/contexts/authContext.tsx +++ b/src/frontend/src/contexts/authContext.tsx @@ -7,6 +7,7 @@ import { requestLogout, } from "../controllers/API"; import useAlertStore from "../stores/alertStore"; +import useFlowsManagerStore from "../stores/flowsManagerStore"; import { Users } from "../types/api"; import { AuthContextType } from "../types/contexts/auth"; @@ -79,6 +80,7 @@ export function AuthProvider({ children }): React.ReactElement { getUser(); } else { setLoading(false); + useFlowsManagerStore.setState({ isLoading: false }); } }); }, [setUserData, setLoading, autoLogin, setIsAdmin]); diff --git a/src/frontend/src/stores/typesStore.ts b/src/frontend/src/stores/typesStore.ts index 1a0ae3634..557a3a30d 100644 --- a/src/frontend/src/stores/typesStore.ts +++ b/src/frontend/src/stores/typesStore.ts @@ -16,7 +16,7 @@ export const useTypesStore = create((set, get) => ({ setLoading(true); getAll() .then((response) => { - const data = response.data; + const data = response?.data; useAlertStore.setState({ loading: false }); set((old) => ({ types: typesGenerator(data),