mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-06-23 21:01:06 +00:00
debug: Add comprehensive logging to profile save/fetch operations
Added detailed console logging to track data flow: - ProfileSettings: Log data being saved and save responses - ProfileSettings: Log data being loaded when page opens - Dashboard: Log profile data being fetched and set to state This will help identify where profile data is being lost between save in ProfileSettings and display in Dashboard. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -32,6 +32,8 @@ export default function Dashboard() {
|
||||
const fetchProfile = async () => {
|
||||
if (!user) return;
|
||||
|
||||
console.log('📥 FETCHING PROFILE for user:', user.id);
|
||||
|
||||
try {
|
||||
const { data, error } = await supabase
|
||||
.from('profiles')
|
||||
@@ -39,6 +41,9 @@ export default function Dashboard() {
|
||||
.eq('id', user.id)
|
||||
.single();
|
||||
|
||||
console.log('📊 FETCHED PROFILE DATA:', data);
|
||||
console.log('❌ Fetch error:', error);
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
// Auto-sync user metadata from Auth to profiles if missing
|
||||
@@ -78,9 +83,10 @@ export default function Dashboard() {
|
||||
// Note: Email verification is handled by Supabase Auth (user.email_confirmed_at)
|
||||
// We don't store it in profiles table to avoid duplication
|
||||
|
||||
console.log('✅ SETTING PROFILE STATE TO:', data);
|
||||
setProfile(data);
|
||||
} catch (error) {
|
||||
console.error('Error fetching profile:', error);
|
||||
console.error('❌ Error fetching profile:', error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user