diff --git a/src/frontend/src/components/common/UserProfile/index.tsx b/src/frontend/src/components/common/UserProfile/index.tsx index ade0db79..b64f406b 100644 --- a/src/frontend/src/components/common/UserProfile/index.tsx +++ b/src/frontend/src/components/common/UserProfile/index.tsx @@ -13,13 +13,14 @@ export default function UserProfile() { const [toggle, setToggle] = useState(false); const navigate = useNavigate(); - const { data: userDetails }: Record = useGetUserDetailsQuery(); + const { data: userDetails, isFetching }: Record = + useGetUserDetailsQuery(); const userProfile = getLocalStorageValue('userprofile'); useEffect(() => { - if (userDetails?.has_user_profile) return; + if (userDetails?.has_user_profile || isFetching) return; if (!userDetails?.has_user_profile) navigate('/complete-profile'); - }, [userDetails?.has_user_profile, navigate]); + }, [userDetails?.has_user_profile, navigate, isFetching]); const settingOptions = [ {