loader fixes
This commit is contained in:
12
src/main.jsx
12
src/main.jsx
@@ -10,6 +10,7 @@ import {
|
||||
import {
|
||||
Box,
|
||||
CssBaseline,
|
||||
CircularProgress,
|
||||
Toolbar
|
||||
} from "@mui/material";
|
||||
import Home from './Home';
|
||||
@@ -81,8 +82,17 @@ const routerMapping = [
|
||||
|
||||
/** Reads authConfig from AppProvider context and passes it to AuthProvider. */
|
||||
function AppContent() {
|
||||
const { authConfig } = useAppContext();
|
||||
const { authConfig, loading } = useAppContext();
|
||||
const navigate = useNavigate();
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<Box sx={{ display: "flex", justifyContent: "center", alignItems: "center", minHeight: "100vh" }}>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<AuthProvider authConfig={authConfig} onUnauthorized={() => navigate("/login")}>
|
||||
<AppTheme>
|
||||
|
||||
Reference in New Issue
Block a user