fix: add hydrated bookmark events to global eventStore

- bookmarkController now accepts eventStore in start() options
- All hydrated events (both by ID and by coordinates) are added to the external eventStore
- This makes hydrated bookmark events available to useEventLoader and other hooks
- Fixes issue where /e/ path couldn't find events because they weren't in the global eventStore
- Now instant loading works for all bookmarked events
This commit is contained in:
Gigi
2025-10-22 00:42:25 +02:00
parent 2254586960
commit 3200bdf378
3 changed files with 19 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ export function useEventLoader({
setIsCollapsed
}: UseEventLoaderProps) {
const displayEvent = useCallback((event: NostrEvent) => {
console.log('🎨 displayEvent: Creating ReadableContent from event')
// Format event metadata as HTML header
const metaHtml = `<div style="opacity: 0.6; font-size: 0.9em; margin-bottom: 1rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.5rem;">
<div>Event ID: <code>${event.id.slice(0, 16)}...</code></div>
@@ -44,6 +45,7 @@ export function useEventLoader({
html: metaHtml + `<div style="white-space: pre-wrap; word-break: break-word;">${escapedContent}</div>`,
title: `Note (${event.kind})`
}
console.log('🎨 displayEvent: Setting readerContent with html:', { title: content.title, htmlLength: content.html?.length })
setReaderContent(content)
}, [setReaderContent])