mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 19:51:13 -05:00
Fix: Correct avatar display in header
This commit is contained in:
@@ -87,8 +87,15 @@ export function AuthButtons() {
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="ghost" className="relative h-8 w-8 rounded-full">
|
||||
<Avatar className="h-8 w-8">
|
||||
<AvatarImage src={profile?.avatar_url || ''} alt={profile?.display_name || profile?.username || ''} />
|
||||
<AvatarFallback>
|
||||
<AvatarImage
|
||||
src={profile?.avatar_url || undefined}
|
||||
alt={profile?.display_name || profile?.username || user.email || 'User avatar'}
|
||||
onError={(e) => {
|
||||
console.warn('[Avatar] Failed to load image:', profile?.avatar_url);
|
||||
e.currentTarget.src = ''; // Force fallback
|
||||
}}
|
||||
/>
|
||||
<AvatarFallback className="bg-primary/10 text-primary font-medium">
|
||||
{(profile?.display_name || profile?.username || user.email || 'U').charAt(0).toUpperCase()}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
|
||||
Reference in New Issue
Block a user