loader fixes

This commit is contained in:
2026-08-01 17:19:58 +05:30
parent 002b22ff0e
commit 51762f8d18

View File

@@ -10,6 +10,7 @@ import {
import { import {
Box, Box,
CssBaseline, CssBaseline,
CircularProgress,
Toolbar Toolbar
} from "@mui/material"; } from "@mui/material";
import Home from './Home'; import Home from './Home';
@@ -81,8 +82,17 @@ const routerMapping = [
/** Reads authConfig from AppProvider context and passes it to AuthProvider. */ /** Reads authConfig from AppProvider context and passes it to AuthProvider. */
function AppContent() { function AppContent() {
const { authConfig } = useAppContext(); const { authConfig, loading } = useAppContext();
const navigate = useNavigate(); const navigate = useNavigate();
if (loading) {
return (
<Box sx={{ display: "flex", justifyContent: "center", alignItems: "center", minHeight: "100vh" }}>
<CircularProgress />
</Box>
);
}
return ( return (
<AuthProvider authConfig={authConfig} onUnauthorized={() => navigate("/login")}> <AuthProvider authConfig={authConfig} onUnauthorized={() => navigate("/login")}>
<AppTheme> <AppTheme>