diff --git a/src/App.js b/src/App.js index 6e19634..154a90e 100644 --- a/src/App.js +++ b/src/App.js @@ -22,6 +22,7 @@ import DetailRoomEducation from "./_screens/home/detail-room-education"; import EducationDepartmentHome from "./_screens/home/education-department"; import { Alert } from "./_components/Alert"; import OutstandingTeacher from "./_screens/home/outstanding-teacher"; +import { TYPE_DISPATCH } from "./_constants/common"; function App() { const dispatch = useDispatch(); @@ -44,6 +45,14 @@ function App() { dispatch(alertActions?.clear()); }); }, []); + + useEffect(() => { + if(authentication?.user?.role === "student"||authentication?.user?.role === "parent") + dispatch({ + type: TYPE_DISPATCH.RESET_AUTHENTICATION, + }); + }, []) + return (