From b728ed6021685643c03451929b1b408af6232ed2 Mon Sep 17 00:00:00 2001 From: luiqor Date: Sat, 23 Nov 2024 13:22:50 +0200 Subject: [PATCH] fix avatarSrc in AccountIcon type check --- src/containers/navigation-icons/AccountIcon.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/containers/navigation-icons/AccountIcon.tsx b/src/containers/navigation-icons/AccountIcon.tsx index 718d91854..28919b8ae 100644 --- a/src/containers/navigation-icons/AccountIcon.tsx +++ b/src/containers/navigation-icons/AccountIcon.tsx @@ -40,11 +40,11 @@ const AccountIcon: FC = ({ openMenu }) => { const { photo: statePhoto } = useAppSelector((state) => state.editProfile) const avatarSrc = useMemo(() => { - if (statePhoto?.src) { + if (typeof statePhoto === 'object' && statePhoto?.src) { return statePhoto.src } - if (photo) { + if (photo || photo === '') { return createUrlPath(import.meta.env.VITE_APP_IMG_USER_URL || '', photo) } }, [photo, statePhoto])