Fix avatar conditional rendering in NavBar and AccountSection

- Remove `{userImage && ...}` guards around AvatarImage; pass `src`
  directly so AvatarFallback renders naturally when src is undefined
- In AccountSection, clear `src` during pending state instead of
  conditionally rendering the image element; guard destructive overlay
  color on `!isPending` so it doesn't flash while uploading
This commit is contained in:
2026-03-08 11:39:46 -04:00
parent 69f04937bc
commit d75d40e63a
2 changed files with 10 additions and 7 deletions
@@ -175,9 +175,10 @@ export function AccountSection({
}
>
<Avatar className="size-12 overflow-hidden">
{avatarUrl && !isPending && (
<AvatarImage src={avatarUrl} alt={displayName} />
)}
<AvatarImage
src={isPending ? undefined : avatarUrl}
alt={displayName}
/>
<AvatarFallback className="bg-primary/10 font-display text-lg text-primary">
{initial}
</AvatarFallback>
@@ -191,7 +192,9 @@ export function AccountSection({
exit={{ opacity: 0 }}
transition={{ duration: 0.15 }}
className={`absolute inset-0 flex items-center justify-center rounded-full text-foreground/70 backdrop-blur-sm ${
avatarUrl ? "bg-destructive/40" : "bg-black/50"
avatarUrl && !isPending
? "bg-destructive/40"
: "bg-black/50"
}`}
>
{isPending ? (