mirror of
https://github.com/dergigi/boris.git
synced 2026-02-23 07:54:59 +01:00
debug: add common prefix [profile-loading-debug] to all debug logs
All profile loading related debug logs now have the common prefix for easy filtering in console.
This commit is contained in:
@@ -46,14 +46,14 @@ const NostrMentionLink: React.FC<NostrMentionLinkProps> = ({
|
||||
// Check cache
|
||||
const cached = loadCachedProfiles([pubkey])
|
||||
if (cached.has(pubkey)) {
|
||||
console.log(`[nostr-mention-link] ${nostrUri.slice(0, 30)}... in cache`)
|
||||
console.log(`[profile-loading-debug][nostr-mention-link] ${nostrUri.slice(0, 30)}... in cache`)
|
||||
return true
|
||||
}
|
||||
// Check eventStore
|
||||
const eventStoreProfile = eventStore?.getEvent(pubkey + ':0')
|
||||
const inStore = !!eventStoreProfile
|
||||
if (inStore) {
|
||||
console.log(`[nostr-mention-link] ${nostrUri.slice(0, 30)}... in eventStore`)
|
||||
console.log(`[profile-loading-debug][nostr-mention-link] ${nostrUri.slice(0, 30)}... in eventStore`)
|
||||
}
|
||||
return inStore
|
||||
}, [pubkey, eventStore, nostrUri])
|
||||
@@ -62,7 +62,7 @@ const NostrMentionLink: React.FC<NostrMentionLinkProps> = ({
|
||||
const isLoading = !profile && pubkey && !isInCacheOrStore &&
|
||||
decoded && (decoded.type === 'npub' || decoded.type === 'nprofile')
|
||||
if (isLoading) {
|
||||
console.log(`[nostr-mention-link] ${nostrUri.slice(0, 30)}... isLoading=true (profile=${!!profile}, pubkey=${!!pubkey}, inCacheOrStore=${isInCacheOrStore})`)
|
||||
console.log(`[profile-loading-debug][nostr-mention-link] ${nostrUri.slice(0, 30)}... isLoading=true (profile=${!!profile}, pubkey=${!!pubkey}, inCacheOrStore=${isInCacheOrStore})`)
|
||||
}
|
||||
|
||||
// If decoding failed, show shortened identifier
|
||||
|
||||
@@ -31,14 +31,14 @@ const ResolvedMention: React.FC<ResolvedMentionProps> = ({ encoded }) => {
|
||||
// Check cache
|
||||
const cached = loadCachedProfiles([pubkey])
|
||||
if (cached.has(pubkey)) {
|
||||
console.log(`[resolved-mention] ${encoded?.slice(0, 16)}... in cache`)
|
||||
console.log(`[profile-loading-debug][resolved-mention] ${encoded?.slice(0, 16)}... in cache`)
|
||||
return true
|
||||
}
|
||||
// Check eventStore
|
||||
const eventStoreProfile = eventStore?.getEvent(pubkey + ':0')
|
||||
const inStore = !!eventStoreProfile
|
||||
if (inStore) {
|
||||
console.log(`[resolved-mention] ${encoded?.slice(0, 16)}... in eventStore`)
|
||||
console.log(`[profile-loading-debug][resolved-mention] ${encoded?.slice(0, 16)}... in eventStore`)
|
||||
}
|
||||
return inStore
|
||||
}, [pubkey, eventStore, encoded])
|
||||
@@ -46,7 +46,7 @@ const ResolvedMention: React.FC<ResolvedMentionProps> = ({ encoded }) => {
|
||||
// Show loading if profile doesn't exist and not in cache/store
|
||||
const isLoading = !profile && pubkey && !isInCacheOrStore
|
||||
if (isLoading && encoded) {
|
||||
console.log(`[resolved-mention] ${encoded.slice(0, 16)}... isLoading=true (profile=${!!profile}, pubkey=${!!pubkey}, inCacheOrStore=${isInCacheOrStore})`)
|
||||
console.log(`[profile-loading-debug][resolved-mention] ${encoded.slice(0, 16)}... isLoading=true (profile=${!!profile}, pubkey=${!!pubkey}, inCacheOrStore=${isInCacheOrStore})`)
|
||||
}
|
||||
|
||||
const display = pubkey ? getProfileDisplayName(profile, pubkey) : encoded
|
||||
|
||||
Reference in New Issue
Block a user