mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 05:51:12 -05:00
feat: Add production-safe logging for avatar debugging
This commit is contained in:
@@ -83,6 +83,17 @@ export function AuthButtons() {
|
||||
</>
|
||||
);
|
||||
}
|
||||
// Debug logging for avatar rendering
|
||||
console.log('[AuthButtons] Component render:', {
|
||||
hasUser: !!user,
|
||||
hasProfile: !!profile,
|
||||
hasAvatarUrl: !!profile?.avatar_url,
|
||||
avatarUrl: profile?.avatar_url,
|
||||
displayName: profile?.display_name,
|
||||
username: profile?.username,
|
||||
loading
|
||||
});
|
||||
|
||||
return <DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="ghost" className="relative h-8 w-8 rounded-full">
|
||||
|
||||
@@ -73,11 +73,13 @@ function AuthProviderComponent({ children }: { children: React.ReactNode }) {
|
||||
|
||||
// Success - update state and complete
|
||||
if (isMountedRef.current) {
|
||||
authLog('[Auth] Profile loaded:', {
|
||||
// Always log profile loading (production-safe)
|
||||
console.log('[Auth] ✅ Profile loaded:', {
|
||||
userId: data?.user_id,
|
||||
username: data?.username,
|
||||
avatar_url: data?.avatar_url,
|
||||
avatar_image_id: data?.avatar_image_id
|
||||
avatar_image_id: data?.avatar_image_id,
|
||||
hasData: !!data
|
||||
});
|
||||
setProfile(data as Profile);
|
||||
profileRetryCountRef.current = 0;
|
||||
|
||||
Reference in New Issue
Block a user