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:
Félix Malfait
2023-07-16 19:03:19 +02:00
committed by GitHub
parent 51d25c3e93
commit 11405f561f
12 changed files with 36 additions and 8 deletions

View File

@ -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}

View File

@ -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}`;
}