registration

This commit is contained in:
Mikola
2023-11-05 20:41:40 +03:00
parent 1e9ee3699d
commit 321b84a80e
6 changed files with 37 additions and 14 deletions

View File

@ -73,8 +73,11 @@ export const Navigation = () => {
if (localStorage.getItem("role_status") === "18") {
return;
}
if (Object.keys(profileInfo).length) {
return;
}
apiRequest(`/user/me`).then((profileInfo) =>
dispatch(setProfileInfo(profileInfo.userCard))
dispatch(setProfileInfo(profileInfo.userCard ? profileInfo.userCard : profileInfo))
);
}, [dispatch]);
@ -93,12 +96,12 @@ export const Navigation = () => {
<div className="profileHeader__personalInfo">
<h3 className="profileHeader__personalInfoName">
{user === "developer" ? profileInfo?.fio : ""}
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
</h3>
<NavLink end to={"/profile"}>
<img
src={
profileInfo.photo ? urlForLocal(profileInfo.photo) : avatarMok
profileInfo?.photo ? urlForLocal(profileInfo.photo) : avatarMok
}
className="profileHeader__personalInfoAvatar"
alt="avatar"