mirror of
https://github.com/dergigi/boris.git
synced 2025-12-25 18:44:23 +01:00
refactor: simplify friends highlights loading to use cached contacts
- Remove redundant contact loading check - Directly use contacts from centralized controller - App.tsx already auto-loads contacts on login - Clearer message indicating cached contacts are being used - Faster execution since no contact loading needed
This commit is contained in:
@@ -465,15 +465,10 @@ const Debug: React.FC<DebugProps> = ({
|
||||
return
|
||||
}
|
||||
|
||||
// Ensure contacts are loaded first (will use cache if already loaded)
|
||||
if (!contactsController.isLoadedFor(activeAccount.pubkey)) {
|
||||
DebugBus.info('debug', 'Loading contacts first...')
|
||||
await contactsController.start({ relayPool, pubkey: activeAccount.pubkey })
|
||||
}
|
||||
|
||||
// Get contacts from centralized controller (should already be loaded by App.tsx)
|
||||
const contacts = contactsController.getContacts()
|
||||
if (contacts.size === 0) {
|
||||
DebugBus.warn('debug', 'No friends found')
|
||||
DebugBus.warn('debug', 'No friends found. Make sure you have contacts loaded.')
|
||||
return
|
||||
}
|
||||
|
||||
@@ -482,7 +477,7 @@ const Debug: React.FC<DebugProps> = ({
|
||||
setIsLoadingHighlights(true)
|
||||
setTLoadHighlights(null)
|
||||
setTFirstHighlight(null)
|
||||
DebugBus.info('debug', `Loading highlights from ${contacts.size} friends...`)
|
||||
DebugBus.info('debug', `Loading highlights from ${contacts.size} friends (using cached contacts)...`)
|
||||
|
||||
let firstEventTime: number | null = null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user