Added clearing monitor state

This commit is contained in:
Alex Holliday committed 2024-06-24 12:00:49 -07:00
1 parent 7d7b155d45
commit 3c8de47c5f
2 files changed
+12 -2

No files matched your search

+3
View File
@@ -14,6 +14,8 @@ import MenuItem from "@mui/material/MenuItem";
import { useTheme } from "@mui/material/styles";
import ChevronDown from "../../assets/Images/Icon-chevron-down.png";
import { clearAuthState } from "../../Features/Auth/authSlice";
import { clearMonitorState } from "../../Features/Monitors/monitorsSlice";
import { useDispatch } from "react-redux";
import { useNavigate } from "react-router-dom";
@@ -52,6 +54,7 @@ function NavBar() {
const logout = () => {
// Clear auth state
dispatch(clearAuthState());
dispatch(clearMonitorState());
navigate("/");
};