diff --git a/src/components/avatar.jsx b/src/components/avatar.jsx index c2aed8ab..c8b7a962 100644 --- a/src/components/avatar.jsx +++ b/src/components/avatar.jsx @@ -16,6 +16,7 @@ const alphaCache = {}; function Avatar({ url, size, alt = '', ...props }) { size = SIZES[size] || size || SIZES.m; const avatarRef = useRef(); + const isMissing = /missing\.png$/.test(url); return ( { if (e.target.crossOrigin) { e.target.crossOrigin = null; @@ -44,6 +49,7 @@ function Avatar({ url, size, alt = '', ...props }) { onLoad={(e) => { if (avatarRef.current) avatarRef.current.dataset.loaded = true; if (alphaCache[url] !== undefined) return; + if (isMissing) return; try { // Check if image has alpha channel const canvas = document.createElement('canvas');