mirror of
https://github.com/dergigi/boris.git
synced 2025-12-18 15:14:20 +01:00
refactor: add logging to verify initialLabels are set correctly from cache
This commit is contained in:
@@ -74,6 +74,9 @@ export function useProfileLabels(content: string, relayPool?: RelayPool | null):
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (labels.size > 0) {
|
||||||
|
console.log(`[${ts()}] [npub-resolve] Initial labels from cache (useMemo):`, labels.size, 'labels')
|
||||||
|
}
|
||||||
return labels
|
return labels
|
||||||
}, [profileData])
|
}, [profileData])
|
||||||
|
|
||||||
@@ -116,6 +119,8 @@ export function useProfileLabels(content: string, relayPool?: RelayPool | null):
|
|||||||
|
|
||||||
// Build labels from localStorage cache and eventStore (initialLabels already has cache, add eventStore)
|
// Build labels from localStorage cache and eventStore (initialLabels already has cache, add eventStore)
|
||||||
// Start with labels from initial cache lookup (in useMemo)
|
// Start with labels from initial cache lookup (in useMemo)
|
||||||
|
// Note: initialLabels should already have all cached profiles, but we rebuild here
|
||||||
|
// to also check EventStore and handle any profiles that weren't in cache
|
||||||
const labels = new Map<string, string>(initialLabels)
|
const labels = new Map<string, string>(initialLabels)
|
||||||
|
|
||||||
const pubkeysToFetch: string[] = []
|
const pubkeysToFetch: string[] = []
|
||||||
|
|||||||
Reference in New Issue
Block a user