Исправление устаревшего имени в UserButton
This commit is contained in:
@@ -5,15 +5,23 @@ import { useNavigate } from 'react-router-dom';
|
||||
import { useUserInformation } from '@/app/providers/InformationProvider/useUserInformation';
|
||||
import { usePublicKey } from '@/app/providers/AccountProvider/usePublicKey';
|
||||
import { useAvatars } from '@/app/providers/AvatarProvider/useAvatars';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export function UserButton() {
|
||||
const navigate = useNavigate();
|
||||
const publicKey = usePublicKey();
|
||||
const [userInfo] = useUserInformation(publicKey);
|
||||
const [userInfo, _, forceUpdateUserInformation] = useUserInformation(publicKey);
|
||||
const avatars = useAvatars(publicKey);
|
||||
|
||||
const loading = userInfo.publicKey !== publicKey;
|
||||
|
||||
useEffect(() => {
|
||||
/**
|
||||
* Обновляем информацию о пользователе принудительно при рендере левого меню
|
||||
*/
|
||||
forceUpdateUserInformation();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<UnstyledButton p={'sm'} className={classes.user} onClick={() => navigate("/main/profile/me")}>
|
||||
<Group>
|
||||
|
||||
Reference in New Issue
Block a user