updates on the session cache

This commit is contained in:
2026-07-01 16:26:22 +05:30
parent c0d3dc35d3
commit 78eabd8d58

View File

@@ -16,6 +16,8 @@ import { useDispatch, useSelector } from 'react-redux';
// ==============================|| APP - THEME, ROUTER, LOCAL ||============================== //
const SESSION_CLEAR_INTERVAL_MS = 30 * 60 * 1000;
const App = () => {
let navigate = useNavigate();
useEffect(() => {
@@ -23,6 +25,14 @@ const App = () => {
navigate('/login');
}
}, []);
useEffect(() => {
const timer = setInterval(() => {
localStorage.clear();
navigate('/login');
}, SESSION_CLEAR_INTERVAL_MS);
return () => clearInterval(timer);
}, []);
const { openItem } = useSelector((state) => state.menu);
console.log('openItem', openItem);