fix(explore,nostrverse): never block explore highlights on nostrverse; show empty state instead of spinner and stream results into store immediately

This commit is contained in:
Gigi
2025-10-19 00:46:16 +02:00
parent 23526954ea
commit 6c00904bd5
2 changed files with 5 additions and 2 deletions

View File

@@ -615,7 +615,7 @@ const Explore: React.FC<ExploreProps> = ({ relayPool, eventStore, settings, acti
}
return classifiedHighlights.length === 0 ? (
<div className="explore-loading" style={{ gridColumn: '1/-1', display: 'flex', justifyContent: 'center', alignItems: 'center', padding: '4rem', color: 'var(--text-secondary)' }}>
<FontAwesomeIcon icon={faSpinner} spin size="2x" />
<span>No highlights to show for the selected scope.</span>
</div>
) : (
<div className="explore-grid">

View File

@@ -106,6 +106,8 @@ export const fetchNostrverseHighlights = async (
console.log('[NOSTRVERSE] 💡 Fetching highlights (kind 9802), limit:', limit)
const seenIds = new Set<string>()
// Collect but do not block callers awaiting network completion
const collected: NostrEvent[] = []
const rawEvents = await queryEvents(
relayPool,
{ kinds: [9802], limit },
@@ -118,6 +120,7 @@ export const fetchNostrverseHighlights = async (
if (eventStore) {
eventStore.add(event)
}
collected.push(event)
}
}
)
@@ -127,7 +130,7 @@ export const fetchNostrverseHighlights = async (
rawEvents.forEach(evt => eventStore.add(evt))
}
const uniqueEvents = dedupeHighlights(rawEvents)
const uniqueEvents = dedupeHighlights([...collected, ...rawEvents])
const highlights = uniqueEvents.map(eventToHighlight)
console.log('[NOSTRVERSE] 💡 Processed', highlights.length, 'unique highlights')