fix: remove white halo around photo avatars
This commit is contained in:
@@ -235,11 +235,10 @@ export function Avatar({ name, email, contactPhotoUri, size = "md", className, d
|
|||||||
// Priority: contact photo > plugin avatar (e.g. Gravatar) > custom avatar > profile picture > company favicon > initials
|
// Priority: contact photo > plugin avatar (e.g. Gravatar) > custom avatar > profile picture > company favicon > initials
|
||||||
const customAvatar = devMode && email ? CUSTOM_AVATARS[email.toLowerCase()] : null;
|
const customAvatar = devMode && email ? CUSTOM_AVATARS[email.toLowerCase()] : null;
|
||||||
const pluginAvatar = pluginAvatarFailed ? null : pluginAvatarUrl;
|
const pluginAvatar = pluginAvatarFailed ? null : pluginAvatarUrl;
|
||||||
const imgSrc = disableImages
|
const photoSrc = resolvedContactPhoto || pluginAvatar || customAvatar || profilePic || null;
|
||||||
? null
|
const faviconSrc = !imgError && !domainFailed && showFavicon ? `/api/favicon?domain=${encodeURIComponent(faviconDomain!)}` : null;
|
||||||
: !imgError && !domainFailed
|
const imgSrc = disableImages ? null : (photoSrc || faviconSrc);
|
||||||
? resolvedContactPhoto || pluginAvatar || customAvatar || profilePic || (showFavicon ? `/api/favicon?domain=${encodeURIComponent(faviconDomain!)}` : null)
|
const isFavicon = imgSrc !== null && imgSrc === faviconSrc;
|
||||||
: (resolvedContactPhoto || pluginAvatar || customAvatar || profilePic || null);
|
|
||||||
|
|
||||||
const handleImgError = useCallback(() => {
|
const handleImgError = useCallback(() => {
|
||||||
// If the plugin avatar just failed, mark it and fall through to the next source
|
// If the plugin avatar just failed, mark it and fall through to the next source
|
||||||
@@ -261,7 +260,7 @@ export function Avatar({ name, email, contactPhotoUri, size = "md", className, d
|
|||||||
sizeClasses[size],
|
sizeClasses[size],
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
style={{ backgroundColor: imgSrc ? "#ffffff" : (fallbackColor ?? getBackgroundColor()) }}
|
style={{ backgroundColor: imgSrc ? (isFavicon ? "#ffffff" : "transparent") : (fallbackColor ?? getBackgroundColor()) }}
|
||||||
title={name || email}
|
title={name || email}
|
||||||
>
|
>
|
||||||
{imgSrc ? (
|
{imgSrc ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user