Files
twenty_crm/front/src/modules/users/utils/getProfilePictureAbsoluteURI.ts
Félix Malfait 11405f561f Bug fix: avatar of account owner not displayed (#690)
* Begin - fix account owner not displayed

* Finish - profile pic of account owner not displayed
2023-07-16 10:03:19 -07:00

16 lines
305 B
TypeScript

export function getImageAbsoluteURIOrBase64(imageUrl?: string | null) {
if (!imageUrl) {
return null;
}
if (imageUrl?.startsWith('data:')) {
return imageUrl;
}
if (imageUrl?.startsWith('https:')) {
return imageUrl;
}
return `${process.env.REACT_APP_FILES_URL}/${imageUrl}`;
}