From e8a3de5d6c16f8a12da911d8be48ceb5b464c97b Mon Sep 17 00:00:00 2001 From: amnambiar Date: Thu, 10 Aug 2023 20:44:04 +0530 Subject: [PATCH] PLT-5535 Bug fix - landing on profile after logout + loader after logout --- .../src/components/AvatarDropdown/AvatarDropdown.tsx | 2 -- react-web/src/pages/certification/Certification.tsx | 10 +++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/react-web/src/components/AvatarDropdown/AvatarDropdown.tsx b/react-web/src/components/AvatarDropdown/AvatarDropdown.tsx index ebb84e7b..d0fbe972 100644 --- a/react-web/src/components/AvatarDropdown/AvatarDropdown.tsx +++ b/react-web/src/components/AvatarDropdown/AvatarDropdown.tsx @@ -41,8 +41,6 @@ const AvatarDropDown = () => { setAnchorEl(null); logOut(); navigate("/"); - setUserDetails({ dapp: null }); - setIsLoggedIn(false); }; return ( diff --git a/react-web/src/pages/certification/Certification.tsx b/react-web/src/pages/certification/Certification.tsx index bfdc1341..d85407ed 100644 --- a/react-web/src/pages/certification/Certification.tsx +++ b/react-web/src/pages/certification/Certification.tsx @@ -45,7 +45,7 @@ const Certification = () => { }); const { uuid } = useAppSelector((state) => state.certification); - const { userDetails, subscribedFeatures } = useAppSelector((state) => state.auth); + const { isLoggedIn, userDetails, subscribedFeatures } = useAppSelector((state) => state.auth); const dispatch = useAppDispatch(); const confirm = useConfirm(); const [submitting, setSubmitting] = useState(false); @@ -248,11 +248,15 @@ const Certification = () => { handleErrorScenario ) + // if not logged in, prevent loader as well + if (!isLoggedIn) { + return null; + } // Show loader until subscribed features is fetched - if (!subscribedFeatures) { + else if (isLoggedIn && !subscribedFeatures) { return ; } - + // else return ( <> {subscribedFeatures?.indexOf("l1-run") === -1 ?