diff --git a/src/frontend/src/utilities/CustomDrawer.jsx b/src/frontend/src/utilities/CustomDrawer.jsx index ed11a7279c..b6f4368292 100644 --- a/src/frontend/src/utilities/CustomDrawer.jsx +++ b/src/frontend/src/utilities/CustomDrawer.jsx @@ -3,9 +3,13 @@ import SwipeableDrawer from '@mui/material/SwipeableDrawer'; import CoreModules from '../shared/CoreModules'; import AssetModules from '../shared/AssetModules'; import { NavLink } from 'react-router-dom'; +import { createLoginWindow } from '../utilfunctions/login'; +import { LoginActions } from '../store/slices/LoginSlice'; +import { ProjectActions } from '../store/slices/ProjectSlice'; -export default function CustomDrawer({ open, placement, size, type, onClose, onSignOut }) { +export default function CustomDrawer({ open, placement, size, type, onClose, onSignOut, setOpen }) { const defaultTheme = CoreModules.useAppSelector((state) => state.theme.hotTheme); + const dispatch = CoreModules.useAppDispatch(); const onMouseEnter = (event) => { const element = document.getElementById(`text${event.target.id}`); @@ -81,6 +85,12 @@ export default function CustomDrawer({ open, placement, size, type, onClose, onS }, ]; + const handleOnSignOut = () => { + setOpen(false); + dispatch(LoginActions.signOut(null)); + dispatch(ProjectActions.clearProjects([])); + }; + return (