updates on the session cache
This commit is contained in:
10
src/App.js
10
src/App.js
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user