From 830534c35c2c6c0f9a354d97c8fa315a3481f432 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Wed, 6 Aug 2025 00:14:02 +0000 Subject: [PATCH] Update fetchUserProfile to handle unconfigured Supabase cgen-ca967e72350940f395e93f0fe652b198 --- client/contexts/AuthContext.tsx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/client/contexts/AuthContext.tsx b/client/contexts/AuthContext.tsx index 7764ab5a..2dd5996a 100644 --- a/client/contexts/AuthContext.tsx +++ b/client/contexts/AuthContext.tsx @@ -84,6 +84,29 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children }, []); const fetchUserProfile = async (userId: string) => { + if (!isSupabaseConfigured) { + // Set demo profile + setProfile({ + id: userId, + username: 'demo-user', + full_name: 'Demo User', + user_type: 'game_developer', + experience_level: 'intermediate', + total_xp: 150, + level: 3, + created_at: new Date().toISOString(), + updated_at: new Date().toISOString(), + avatar_url: null, + bio: 'Demo user profile', + location: null, + website_url: null, + github_url: null, + twitter_url: null, + linkedin_url: null, + }); + return; + } + try { const { data, error } = await supabase .from('user_profiles')