Skip to content

Commit

Permalink
Fixed changing a user photo in the header
Browse files Browse the repository at this point in the history
  • Loading branch information
Made1ra committed Nov 20, 2024
1 parent e77d6cc commit 1ca6ed5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/containers/navigation-icons/AccountIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, FC, MouseEvent } from 'react'
import { useMemo, useCallback, FC, MouseEvent } from 'react'
import { useTranslation } from 'react-i18next'
import { useAppSelector } from '~/hooks/use-redux'
import { AxiosResponse } from 'axios'
Expand Down Expand Up @@ -39,7 +39,7 @@ const AccountIcon: FC<AccountIconProps> = ({ openMenu }) => {

const { photo: statePhoto } = useAppSelector((state) => state.editProfile)

const getAvatarSrc = useCallback(() => {
const avatarSrc = useMemo(() => {
if (statePhoto?.src) {
return statePhoto.src
}
Expand All @@ -49,8 +49,6 @@ const AccountIcon: FC<AccountIconProps> = ({ openMenu }) => {
}
}, [photo, statePhoto])

const avatarSrc = getAvatarSrc()

if (loading) {
return <Avatar sx={styles.accountIcon} />
}
Expand Down

0 comments on commit 1ca6ed5

Please sign in to comment.