Fix avatar loading by preventing profile state race condition

This commit is contained in:
gpt-engineer-app[bot]
2025-10-13 17:13:37 +00:00
parent 7d6c0aabcf
commit 5863a49d3a
2 changed files with 17 additions and 20 deletions

View File

@@ -97,7 +97,7 @@ export function AuthButtons() {
return <DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" className="relative h-8 w-8 rounded-full">
<Avatar className="h-8 w-8">
<Avatar className="h-8 w-8" key={profile?.avatar_url || 'fallback'}>
<AvatarImage
src={profile?.avatar_url || undefined}
alt={profile?.display_name || profile?.username || user.email || 'User avatar'}