mirror of
https://github.com/dergigi/boris.git
synced 2026-01-31 12:44:37 +01:00
feat(ui): improve logged-in user profile resolution
- Add debug logging to track profile loading - Show 'Loading profile...' while profile data is being fetched - Better handling of profile loading states - Ensures user sees proper name instead of pubkey when available
This commit is contained in:
@@ -75,6 +75,10 @@ const Bookmarks: React.FC<BookmarksProps> = ({ relayPool, onLogout }) => {
|
||||
const formatUserDisplay = () => {
|
||||
if (!activeAccount) return 'Unknown User'
|
||||
|
||||
// Debug profile loading
|
||||
console.log('Profile data:', profile)
|
||||
console.log('Active account pubkey:', activeAccount.pubkey)
|
||||
|
||||
// Use profile data from ProfileModel if available
|
||||
if (profile?.name) {
|
||||
return profile.name
|
||||
@@ -86,6 +90,11 @@ const Bookmarks: React.FC<BookmarksProps> = ({ relayPool, onLogout }) => {
|
||||
return profile.nip05
|
||||
}
|
||||
|
||||
// Show loading state while profile is being fetched
|
||||
if (profile === undefined) {
|
||||
return 'Loading profile...'
|
||||
}
|
||||
|
||||
// Fallback to formatted public key
|
||||
return `${activeAccount.pubkey.slice(0, 8)}...${activeAccount.pubkey.slice(-8)}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user