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