Fix blank avatars, duplicate recent media, static message details
This commit is contained in:
parent
5c1776e00e
commit
1e3de45af6
3 changed files with 39 additions and 23 deletions
|
@ -119,9 +119,14 @@ export const AvatarPreview = ({
|
|||
}, [avatarPreview]);
|
||||
|
||||
let imageStatus: ImageStatus;
|
||||
let encodedPath: string | undefined;
|
||||
if (avatarValue && !objectUrl) {
|
||||
imageStatus = ImageStatus.Loading;
|
||||
} else if (objectUrl || avatarPath) {
|
||||
} else if (objectUrl) {
|
||||
encodedPath = objectUrl;
|
||||
imageStatus = ImageStatus.HasImage;
|
||||
} else if (avatarPath) {
|
||||
encodedPath = encodeURI(avatarPath);
|
||||
imageStatus = ImageStatus.HasImage;
|
||||
} else {
|
||||
imageStatus = ImageStatus.Nothing;
|
||||
|
@ -164,10 +169,10 @@ export const AvatarPreview = ({
|
|||
className={`AvatarPreview__avatar AvatarPreview__avatar--${imageStatus}`}
|
||||
{...clickProps}
|
||||
style={
|
||||
imageStatus === ImageStatus.HasImage
|
||||
imageStatus === ImageStatus.HasImage && encodedPath
|
||||
? {
|
||||
...componentStyle,
|
||||
backgroundImage: `url('${objectUrl || avatarPath}')`,
|
||||
backgroundImage: `url('${encodedPath}')`,
|
||||
}
|
||||
: componentStyle
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue