Bug fix: avatar of account owner not displayed (#690)
* Begin - fix account owner not displayed * Finish - profile pic of account owner not displayed
This commit is contained in:
@ -3,6 +3,8 @@ import styled from '@emotion/styled';
|
||||
import { stringToHslColor } from '@/utils/string-to-hsl';
|
||||
import { isNonEmptyString } from '@/utils/type-guards/isNonEmptyString';
|
||||
|
||||
import { getImageAbsoluteURIOrBase64 } from '../utils/getProfilePictureAbsoluteURI';
|
||||
|
||||
export type AvatarType = 'squared' | 'rounded';
|
||||
|
||||
type OwnProps = {
|
||||
@ -44,7 +46,7 @@ export function Avatar({
|
||||
|
||||
return (
|
||||
<StyledAvatar
|
||||
avatarUrl={avatarUrl}
|
||||
avatarUrl={getImageAbsoluteURIOrBase64(avatarUrl)}
|
||||
placeholder={placeholder}
|
||||
size={size}
|
||||
type={type}
|
||||
|
||||
@ -7,5 +7,9 @@ export function getImageAbsoluteURIOrBase64(imageUrl?: string | null) {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
if (imageUrl?.startsWith('https:')) {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
return `${process.env.REACT_APP_FILES_URL}/${imageUrl}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user