* Begin - fix account owner not displayed * Finish - profile pic of account owner not displayed
16 lines
305 B
TypeScript
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}`;
|
|
}
|