Skip to content

Commit

Permalink
PLT-5535 Bug fix - landing on profile after logout + loader after logout
Browse files Browse the repository at this point in the history
  • Loading branch information
amnambiar committed Aug 10, 2023
1 parent d4e5ad2 commit e8a3de5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions react-web/src/components/AvatarDropdown/AvatarDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ const AvatarDropDown = () => {
setAnchorEl(null);
logOut();
navigate("/");
setUserDetails({ dapp: null });
setIsLoggedIn(false);
};

return (
Expand Down
10 changes: 7 additions & 3 deletions react-web/src/pages/certification/Certification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 <Loader />;
}

// else
return (
<>
{subscribedFeatures?.indexOf("l1-run") === -1 ?
Expand Down

0 comments on commit e8a3de5

Please sign in to comment.