update settings

This commit is contained in:
Alex Holliday
2024-09-27 12:13:39 +08:00
parent 488ba717ac
commit 5c4d094da7
6 changed files with 126 additions and 13 deletions
+10
View File
@@ -37,6 +37,8 @@ import { CssBaseline } from "@mui/material";
import { useEffect } from "react";
import { useDispatch } from "react-redux";
import { getAppSettings } from "./Features/Settings/settingsSlice";
import { logger } from "./Utils/Logger"; // Import the logger
import { networkService } from "./main";
function App() {
const AdminCheckedRegister = withAdminCheck(Register);
const MonitorsWithAdminProp = withAdminProp(Monitors);
@@ -54,6 +56,14 @@ function App() {
dispatch(getAppSettings(authToken));
}, [dispatch, authToken]);
// Cleanup
useEffect(() => {
return () => {
logger.cleanup();
networkService.cleanup();
};
}, []);
return (
<ThemeProvider theme={mode === "light" ? lightTheme : darkTheme}>
<CssBaseline />