Added clearing monitor state
This commit is contained in:
1 parent
7d7b155d45
commit
3c8de47c5f
2 files changed
+12
-2
No files matched your search
@@ -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("/");
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user