loadprofile loop bug fixed

This commit is contained in:
victorAnumudu
2023-05-03 23:49:56 +01:00
parent 1d18d8e6ac
commit fb4939946e
3 changed files with 52 additions and 88 deletions
+1 -4
View File
@@ -46,13 +46,10 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
setIsLogin({loading: false, status: false})
})
}
const getProfile = useCallback(()=>{
loadProfile() // API CALL TO GET USER PROFILE
}, [])
useEffect(() => {
if(!isLogin.status){
getProfile()
loadProfile() // LOADS USER PROFILE DETAILS AND CALLS DISPATCH UPDATEUSERDETAILS TO UPDATE USERDETAILS SLICE IN STORE
}
const checkInactivity = setInterval(() => {