From af6ee133a81306199d9c45e6c2a66c1f4630379c Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 4 Oct 2025 21:36:11 +0000 Subject: [PATCH] Add fallback for getProfileById cgen-8dcf6530c8884437b5882ce9eff1fc9a --- client/lib/aethex-database-adapter.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/client/lib/aethex-database-adapter.ts b/client/lib/aethex-database-adapter.ts index 6f63ccb5..1dc18e27 100644 --- a/client/lib/aethex-database-adapter.ts +++ b/client/lib/aethex-database-adapter.ts @@ -318,6 +318,25 @@ export const aethexUserService = { async getProfileById(userId: string): Promise { if (!userId) return null; + + if (!isSupabaseConfigured) { + const profile = await mockAuth.getUserProfile(userId); + if (!profile) { + return null; + } + + return normalizeProfile( + { + ...profile, + user_type: (profile as any)?.user_type ?? "game_developer", + experience_level: (profile as any)?.experience_level ?? "beginner", + total_xp: (profile as any)?.total_xp ?? 0, + level: (profile as any)?.level ?? 1, + }, + (profile as any)?.email ?? null, + ); + } + ensureSupabase(); const { data, error } = await supabase