Browse Source

fix: fixed profile images not displaying

develop
Ezerous 4 years ago
parent
commit
c7e38b91e6
  1. 8
      packages/concordia-app/src/components/ProfileImage.jsx

8
packages/concordia-app/src/components/ProfileImage.jsx

@ -6,7 +6,7 @@ import { USER_PROFILE_PICTURE } from '../constants/orbit/UserDatabaseKeys';
const ProfileImage = (props) => { const ProfileImage = (props) => {
const { const {
profileAddress, profileUsername, topicAuthorMeta, avatarUrl, size, link, profileAddress, profileUsername, profileUserMeta, avatarUrl, size, link,
} = props; } = props;
const stopClickPropagation = (event) => { const stopClickPropagation = (event) => {
@ -16,7 +16,9 @@ const ProfileImage = (props) => {
const authorAvatar = useMemo(() => { const authorAvatar = useMemo(() => {
let profileImageUrl = ''; let profileImageUrl = '';
if (avatarUrl) profileImageUrl = avatarUrl; if (avatarUrl) profileImageUrl = avatarUrl;
else if (topicAuthorMeta && topicAuthorMeta[USER_PROFILE_PICTURE]) profileImageUrl = topicAuthorMeta[USER_PROFILE_PICTURE]; else if (profileUserMeta && profileUserMeta[USER_PROFILE_PICTURE]) {
profileImageUrl = profileUserMeta[USER_PROFILE_PICTURE];
}
return ( return (
<Avatar <Avatar
@ -26,7 +28,7 @@ const ProfileImage = (props) => {
src={profileImageUrl} src={profileImageUrl}
/> />
); );
}, [avatarUrl, size, profileUsername, topicAuthorMeta]); }, [avatarUrl, size, profileUsername, profileUserMeta]);
return useMemo(() => { return useMemo(() => {
if (link && profileAddress) { if (link && profileAddress) {

Loading…
Cancel
Save