fix api /me
This commit is contained in:
@ -273,15 +273,15 @@ export const ProfileCalendarComponent = React.memo(
|
||||
? `${getCorrectDate(startDate)} - ${getCorrectDate(endDate)}`
|
||||
: `${getCorrectDate(endDate)} - ${getCorrectDate(startDate)}`
|
||||
: activePeriod
|
||||
? "Выберите диапазон на календаре"
|
||||
: "Выбрать диапазон"}
|
||||
? "Выберите диапазон на календаре"
|
||||
: "Выбрать диапазон"}
|
||||
</span>
|
||||
<span>
|
||||
{totalRangeHours
|
||||
? `${totalRangeHours} ${hourOfNum(totalRangeHours)}`
|
||||
: endDate
|
||||
? "0 часов"
|
||||
: ""}
|
||||
? "0 часов"
|
||||
: ""}
|
||||
</span>
|
||||
{endDate && (
|
||||
<BaseButton
|
||||
|
@ -34,13 +34,14 @@ export const ProfileHeader = () => {
|
||||
// }, [dispatch]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!Object.keys(profileInfo).length) apiRequest(`/user/me`).then((profileInfo) => {
|
||||
dispatch(
|
||||
setProfileInfo(
|
||||
profileInfo.userCard ? profileInfo.userCard : profileInfo
|
||||
)
|
||||
);
|
||||
});
|
||||
if (!Object.keys(profileInfo).length)
|
||||
apiRequest(`/user/me`).then((profileInfo) => {
|
||||
dispatch(
|
||||
setProfileInfo(
|
||||
profileInfo.userCard ? profileInfo.userCard : profileInfo
|
||||
)
|
||||
);
|
||||
});
|
||||
}, []);
|
||||
|
||||
const handler = () => {
|
||||
@ -49,7 +50,7 @@ export const ProfileHeader = () => {
|
||||
dispatch(auth(false));
|
||||
setIsLoggingOut(false);
|
||||
navigate("/auth");
|
||||
dispatch(setProfileInfo({}))
|
||||
dispatch(setProfileInfo({}));
|
||||
};
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user