fix(ui): paint avatar fallback gradient before broken-img onError

The fallback <div>'s inline style only carried `background` when src was
falsy, so an <img> that 404'd flipped to display:flex via onError but with
no gradient applied — surfacing a colorless letter for any broken avatar
URL. Always paint the gradient + fontSize; keep `display:none` as the only
src-conditional override.
This commit is contained in:
Jannis Braun
2026-05-05 01:58:29 +02:00
parent 06498836bb
commit fb96b1457a
+1 -1
View File
@@ -120,7 +120,7 @@ export function Avatar({ src, name, size = 40, status, className = '', onClick,
) : null}
<div
className={`avatar-fallback w-full h-full rounded-full flex items-center justify-center font-bold text-white ${src ? 'hidden' : 'flex'}`}
style={src ? { display: 'none' } : { background: gradient.gradient, fontSize: fontPx }}
style={{ background: gradient.gradient, fontSize: fontPx, ...(src ? { display: 'none' } : {}) }}
>
{initials}
</div>